We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a872093 commit 4cb08d9Copy full SHA for 4cb08d9
src/Adapters/Storage/Mongo/MongoStorageAdapter.js
@@ -105,7 +105,20 @@ export class MongoStorageAdapter {
105
const encodedUri = formatUrl(parseUrl(this._uri));
106
107
this.connectionPromise = MongoClient.connect(encodedUri, this._mongoOptions).then(database => {
108
+ if (!database) {
109
+ delete this.connectionPromise;
110
+ return;
111
+ }
112
+ database.on('error', (error) => {
113
114
+ });
115
+ database.on('close', (error) => {
116
117
118
this.database = database;
119
+ }).catch((err) => {
120
121
+ return Promise.reject(err);
122
});
123
124
return this.connectionPromise;
0 commit comments