Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MongoError

privateremarks

CSFLE has a dependency on this error, it uses the constructor with a string argument

Hierarchy

Index

Constructors

constructor

  • new MongoError(message: string | Error): MongoError

Properties

[kErrorLabels]

[kErrorLabels]: Set<string>
internal

Optional code

code: string | number

message

message: string

Optional stack

stack: string

Optional topologyVersion

topologyVersion: TopologyVersion

Static Optional prepareStackTrace

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

Type declaration

    • (err: Error, stackTraces: CallSite[]): any
    • Optional override for formatting stack traces

      Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

Static stackTraceLimit

stackTraceLimit: number

Accessors

errmsg

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

    Returns string

errorLabels

  • get errorLabels(): string[]

name

  • get name(): string

Methods

addErrorLabel

  • addErrorLabel(label: string): void

hasErrorLabel

  • hasErrorLabel(label: string): boolean
  • 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

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