Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/support/error"

Index

Functions

errMsg

  • errMsg(e: any): string
  • Extract message from a variety of error types. If message is not found in any of the standard places, safely stringify the error.

    Parameters

    • e: any

      Some sort of Error or similar

    Returns string

    Error message

keyFilter

  • keyFilter<T>(key: string, value: T): T | string | undefined
  • Omit possibly secret values from stringified object.

    Type parameters

    • T

    Parameters

    • key: string
    • value: T

    Returns T | string | undefined

maskString

  • maskString(raw: string): string
  • Mask a string containing potentially sensitive information.

    Parameters

    • raw: string

      String to mask

    Returns string

    Masked string

requestErrMsg

  • Extract an error message from the error object, which may have derived from a request response.

    Parameters

    Returns string | undefined

    Error message if found, undefined otherwise

requestError

  • Create an Error object from a request response and body. The response and body will be included in the Error object.

    Parameters

    Returns Error & RequestResponse

    Error object with meaningful message, if possible

Generated using TypeDoc