An error is a kind of problems that justify aborting the execution immediately.

Hierarchy (view full)

Constructors

Constructors

  • The constructor for generic Gobstones errors.

    Parameters

    • context: string

      The context is the module that signals the problem. Its value is expected to be a field in the Locale of the component (Lexer, Parser, etc.).

    • key: string

      A string indicating where to locate the concrete error message. Its value is expected to be one of the error fields corresponding to the error field of the context field in the Locale of the component.

    • Optional interpolations: Record<string, any>

      A record indicating values for interpolations used in the value associated with the key given. Its value is expected to match with the arguments of the corresponding key in the Locale of the component. It may be undefined if there are none, in which case the empty record is used.

    • Optional span: Span

    Returns GError