get id()

The get accessor gets the error identification

CommonError.prototype.id

The getarrow-up-right accessor gets the error identification by returning the #id property of a specified object.

common-error.class.ts
public get id(): Id | undefined {
  return this.#id;
}

Return type

The return type is the generic type variable Id or undefinedarrow-up-right.

Returns

The return value is the error identification of the generic type variable Id or undefinedarrow-up-right.

Example usage

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

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

// Returns "(AE:427)".
new TestError('problem', 'Fix accessor.', '(AE:427)').id;

Last updated