Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MongoError

privateremarks

mongodb-client-encryption has a dependency on this error, it uses the constructor with a string argumentmongodb客户端加密依赖于此错误,它使用带字符串参数的构造函数

Hierarchy继承层级

Index索引

Constructors构造函数

  • new MongoError(message: string | Error): MongoError
  • Parameters参数

    • message: string | Error

    Returns 返回 MongoError

Properties属性

cause?: Error
code?: string | number

This is a number in MongoServerError and a string in MongoDriverError这是MongoServerError中的数字和MongoDriverError的字符串

privateremarks

Define the type override on the subclasses when we can use the override keyword当我们可以使用override关键字时,在子类上定义类型重写

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

Type declaration类型声明

stackTraceLimit: number

Accessors访问器

  • get errmsg(): string
  • Legacy name for server error responses服务器错误响应的旧名称

    Returns 返回 string

  • get errorLabels(): string[]
  • get name(): string
  • Returns 返回 string

Methods方法

  • addErrorLabel(label: string): void
  • Parameters参数

    • label: string

    Returns 返回 void

  • 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如果错误具有提供的错误标签,则返回true

  • captureStackTrace(targetObject: object, constructorOpt?: Function): void
  • Create .stack property on a target object在目标对象上创建.stack属性

    Parameters参数

    • targetObject: object
    • Optional constructorOpt: Function

    Returns 返回 void

Generated using TypeDoc