Class MongoError

Hierarchy (view full)

Constructors

  • Do not use this constructor!

    Meant for internal use only.

    Parameters

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

    Returns MongoError

    This class is only meant to be constructed within the driver. This constructor is not subject to semantic versioning compatibility guarantees and may change at any time.

Properties

cause?: Error
code?: string | number

This is a number in MongoServerError and a string in MongoDriverError

connectionGeneration?: number
message: string
stack?: string
topologyVersion?: TopologyVersion
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Accessors

  • get errmsg(): string
  • Legacy name for server error responses

    Returns string

Methods

  • Parameters

    • label: string

    Returns void

  • Checks the error to see if it has an error label

    Parameters

    • label: string

      The error label to check for

    Returns boolean

    returns true if the error has the provided error label

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void