Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ErrorWithContext

An Error base-class that also provides some additional context.

All first-party error handlers in Extollo can render the context as part of the display of the error (e.g. in the console, in the HTML response, &c.)

example
function myFunc(arg1, arg2) {
    // ...do something...
    throw new ErrorWithContext('Something went wrong!', { arg1, arg2 })
}

Hierarchy

Index

Constructors

constructor

Properties

context

context: {} = {}

Type declaration

  • [key: string]: any

message

message: string

name

name: string

Optional originalError

originalError: Error

Optional stack

stack: string

Static Optional prepareStackTrace

prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any

Optional override for formatting stack traces

see

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Type declaration

    • (err: Error, stackTraces: CallSite[]): any
    • Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

Static stackTraceLimit

stackTraceLimit: number

Methods

Static captureStackTrace

  • captureStackTrace(targetObject: object, constructorOpt?: Function): void
Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.