Options
All
  • Public
  • Public/Protected
  • All
Menu

Generic error class with serialization options

export

Type parameters

  • T = any

Hierarchy

  • Error
    • GoodchatError

Index

Constructors

constructor

  • new GoodchatError<T>(message: string, status: number, details?: T, type?: string): GoodchatError<T>

Properties

Optional details

details: undefined | T

message

message: string

name

name: string

Optional stack

stack: undefined | string

status

status: number

type

type: string

Private Static i18n

i18n: I18n = ...

Optional Static prepareStackTrace

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

Optional override for formatting stack traces

see

https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces

Static stackTraceLimit

stackTraceLimit: number

Accessors

Private i18n

  • get i18n(): I18n

Methods

serialize

  • serialize(lang?: string): { error: string; status: number; type: string }
  • Parameters

    • lang: string = ...

    Returns { error: string; status: number; type: string }

    • error: string
    • status: number
    • type: string

toApolloError

  • toApolloError(lang?: string): ApolloError

translatedMessage

  • translatedMessage(lang?: string): string

Static captureStackTrace

  • captureStackTrace(targetObject: object, constructorOpt?: Function): void
  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc