githubEdit

get name()

The `get` accessor obtains error object name

Error.prototype.name

Error name of a stringarrow-up-right type, set to 'Error'arrow-up-right that is being thrown.

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

Return type

Returns

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

Example usage

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

// Returns "Error".
new Error('Wrong type', 'Change the type', 'TE:201').name;

Last updated