get name()

The `get` accessor obtains error name

TypeError.prototype.name

The getarrow-up-right accessor obtains error name of a stringarrow-up-right type, set to 'TypeError' that is being thrown.

type-error.class.ts
public get name(): string {
  return 'TypeError';
}

Return type

Returns

The return value is the error instance name of stringarrow-up-right type.

Example usage

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

// Returns "TypeError".
new TypeError('problem', 'Fix accessor.').name;

Last updated

Was this helpful?