get id()
The get accessor gets the error identification
CommonError.prototype.id
CommonError.prototype.id
The get
accessor gets the error identification by returning the #id
property of a specified object.
public get id(): Id | undefined {
return this.#id;
}
Return type
The return type is the generic type variable Id
or undefined
.
Returns
The return value is the error identification of the generic type variable Id
or undefined
.
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
Was this helpful?