[mongodb] MongoError constructor accept string and object (#43383)

* MongoError constructor accept string and object

* Re-run CI

* Add Error as accepted types for MongoError constructor

* Re-run CI
This commit is contained in:
Mathieu Ghennassia 2020-03-27 06:19:25 +01:00 committed by GitHub
parent 7621f3b99c
commit cc70df9691
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -230,11 +230,11 @@ export type WithTransactionCallback<T> = (session: ClientSession) => Promise<T>;
* see {@link http://mongodb.github.io/node-mongodb-native/3.5/api/MongoError.html}
*/
export class MongoError extends Error {
constructor(message: string);
constructor(message: string | Error | object);
/**
* @deprecated
*/
static create(options: string): MongoError;
static create(options: string | Error | object): MongoError;
/**
* Checks the error to see if it has an error label
*/