Class BSONError

Hierarchy (view full)

Constructors

  • Parameters

    • message: string
    • Optionaloptions: {
          cause?: unknown;
      }
      • Optionalcause?: unknown

    Returns BSONError

Properties

cause?: unknown
message: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Accessors

  • get name(): string
  • Returns string

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

  • All errors thrown from the BSON library inherit from BSONError. This method can assist with determining if an error originates from the BSON library even if it does not pass an instanceof check against this class' constructor.

    Parameters

    • value: unknown

      any javascript value that needs type checking

    Returns value is BSONError