get message()

The get accessor gets the error message

CommonError.prototype.message

The get accessor gets the error message by returning the parent message property of the Error object.

common-error.class.ts
public get message(): string {
  return super.message;
}

Return type

Returns

The return value is the error message of a string type.

Example usage

// Example usage.
import { CommonError } from '@angular-package/error';

// Extend the `CommonError` class.
class TestError<Id extends string> extends CommonError<Id> {}

// Returns "Problem(AE:427): Problem accessor. => Fix: Fix accessor.".
new TestError('Problem accessor.', 'Fix accessor.', '(AE:427)').message;

Last updated