Class LocalizedError

An error that has some localized information attached to it.

This error has extra meta data associated with the error that can be translated into different locales.

Hierarchy

  • Error
    • LocalizedError

Constructors

  • Constructs a new parse error.

    Parameters

    • __namedParameters: {
          args?: Record<string, string | number>;
          index?: number;
          lex: string;
          message: string;
      }
      • Optional args?: Record<string, string | number>
      • Optional index?: number
      • lex: string
      • message: string

    Returns LocalizedError

Properties

cause?: unknown
message: string
name: string
stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Type declaration

stackTraceLimit: number

Accessors

  • get args(): Record<string, string | number>
  • Returns Record<string, string | number>

    The arguments associated with the lexicon key to create a localized error message.

  • get index(): undefined | number
  • Returns undefined | number

    The index number of the character from the input originally associated with the error. Please note, this may return undefined if no line number was originally associated with the error.

  • get lex(): string
  • Returns string

    The lexicon key associated with the error. If the looked up lexicon key has '%s', these will be replaced by arguments from in args.

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc