get name()

The `get` accessor obtains error name

TypeError.prototype.name

The get accessor obtains error name of a string 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 string type.

Example usage

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

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

Last updated