From cc70df9691a468238319c431a1a2fbf22dccf2cc Mon Sep 17 00:00:00 2001 From: Mathieu Ghennassia Date: Fri, 27 Mar 2020 06:19:25 +0100 Subject: [PATCH] [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 --- types/mongodb/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index d834e7cb4d..e114581006 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -230,11 +230,11 @@ export type WithTransactionCallback = (session: ClientSession) => Promise; * 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 */