Abstract
Internal
Should not be instantiated by the user.
Readonly
detailedA list of errors 1:1 with the number of errorful API requests made to the server. Each element contains the original command, the raw response, and the error descriptors for that request.
For operations that only make one request, this will be a singleton list (i.e. insertOne
).
Readonly
errorA list of error descriptors representing the individual errors returned by the API.
This is always equal to detailedErrorDescriptors.flatMap(d => d.errorDescriptors)
, for the user's
convenience.
Readonly
messageA human-readable message describing the first error.
This is always equal to errorDescriptors[0]?.message
if it exists, otherwise it's given a generic
default message.
Readonly
partialThe partial result of the operation that was performed. This is always defined, and is
the result of the operation up to the point of the first error. For example, if you're inserting 100 documents
ordered and the 50th document fails, the partialResult
will contain the first 49 documents that were
successfully inserted.
Optional
stackStatic
Optional
prepareOptional override for formatting stack traces
Static
stackStatic
capture
An abstract class representing an exception that occurred due to a cumulative operation on the Data API. This is the base class for all Data API errors that represent a paginated operation, such as
insertMany
,deleteMany
, andupdateMany
, and will never be thrown directly.Useful for
instanceof
checks.This is only for Data API related errors, such as a non-existent collections, or a duplicate key error. It is not, however, for errors such as an HTTP network error, or a malformed request. The exception being timeouts, which are represented by the DataAPITimeoutError class.
Field
message - A human-readable message describing the first error
Field
errorDescriptors - A list of error descriptors representing the individual errors returned by the API
Field
detailedErrorDescriptors - A list of errors 1:1 with the number of errorful API requests made to the server.
Field
partialResult - The partial result of the operation that was performed