Class MongoWriteConcernError

An error thrown when the server reports a writeConcernError

Hierarchy

Constructors

  • Do not use this constructor!

    Meant for internal use only.

    Parameters

    • result: {
          errorLabels?: string[];
          writeConcernError: {
              code: number;
              codeName?: string;
              errInfo?: Document;
              errmsg: string;
          };
      }
      • Optional errorLabels?: string[]
      • writeConcernError: {
            code: number;
            codeName?: string;
            errInfo?: Document;
            errmsg: string;
        }
        • code: number
        • Optional codeName?: string
        • Optional errInfo?: Document
        • errmsg: string

    Returns MongoWriteConcernError

    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

codeName?: string
connectionGeneration?: number
errInfo?: Document
errorResponse: ErrorDescription

Raw error result document returned by server.

message: string
ok?: number
result: Document

The result document

stack?: string
topologyVersion?: TopologyVersion
writeConcernError?: Document
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

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc