Class MongoAPIError

An error generated when the driver API is used incorrectly驱动程序API使用不正确时生成的错误

Hierarchy

Constructors

  • Do not use this constructor!不要使用此构造函数!

    Meant for internal use only.仅供内部使用。

    Parameters

    • message: string
    • Optional options: {
          cause?: Error;
      }
      • Optional cause?: Error

    Returns MongoAPIError

    Remarks

    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这是MongoServerError中的一个数字,也是MongoDriverError中的字符串

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

Type declaration

stackTraceLimit: number

Accessors

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

    Returns string

  • get errorLabels(): string[]
  • Returns string[]

  • get name(): string
  • Returns string

Methods

  • 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

  • Create .stack property on a target object在目标对象上创建.stack属性

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc