Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseError

An enhanced error instance for the TS Framework.
Basic features:

  • Unique stack id using UUID v4
  • Serializers: toObject and toJSON
  • Better stack trace mapping using "clean-stack"
  • Inherits errors with rich stack trace and json outputs

Hierarchy

Index

Constructors

constructor

  • new BaseError(input?: any, details?: any): BaseError

Properties

Protected Optional _cleanStack

_cleanStack: (input: string) => string

The clean-stack wrapper when available.

Type declaration

    • (input: string): string
    • Parameters

      • input: string

      Returns string

details

The error details for easier tracking of exceptions

message

message: string

name

name: string

originalMessage

originalMessage: string

The error original message without the generated metadata.

Optional stack

stack: string

stackId

stackId: string

The unique exception id.

Static Error

Error: ErrorConstructor

Methods

toJSON

  • toJSON(stringify?: boolean): any
  • Generates clean object for this error instance ready for JSON stringification (optional).

    Parameters

    • Default value stringify: boolean = false

      Flag to enable stringification

    Returns any

toObject

  • toObject(): { details: BaseErrorDetails; message: string; stack: string; stackId: string }

Generated using TypeDoc