Class BlipInspectionError

A BlipInspectionError is a special representation of BlipError that can be inspected by the console or used in custom logging solutions.

Remarks

BlipError instances can be inspected directly when using the console in Node.js, without the need to use .inspection. Some custom logging solutions such as Pino and Winston may omit/repeat data and require the use of .inspection to be represented correctly. For example, rootErr may be omitted from the logs without .inspection.

Hierarchy

  • BlipBase
    • BlipInspectionError

Constructors

  • Internal

    Should not be used directly.

    Parameters

    • Optional message: string

      The error message.

    • Optional options: BlipOptions

      An object containing options for the error.

    Returns BlipInspectionError

Properties

_rootErr: undefined | Error

For internal use - use rootErr instead.

data: undefined | object

Metadata associated with the error.

See

BlipOptions

message: string

A message associated with the error.

Default Value

''

Remarks

This is designed to be public-facing.

name: "BlipError" = 'BlipError'

Name of the Error - always 'BlipError'.

rootErr?: {
    message: string;
    name: string;
}

Type declaration

  • message: string
  • name: string
server: boolean

truthy when the error is a server error (status code >= 500), otherwise falsy.

stack: undefined | string

Stack trace associated with the Error.

Default Value

The default is the stack trace of rootErr if provided in BlipOptions, otherwise the stack trace of the BlipError which is automatically generated.

statusCode: number

HTTP Status code associated with the error.

See

BlipOptions

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

Type declaration

stackTraceLimit: number

Accessors

  • get code(): number
  • Alias for statusCode.

    Alias

    statusCode

    Returns number

  • get originalStack(): undefined | string
  • Used to obtain the original stack when a rootErr was provided. (If a rootErr.stack is present, it will take the place of the BlipError stack).

    Returns undefined | string

  • get status(): number
  • Alias for statusCode.

    Alias

    statusCode

    Returns number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc