Add a timeout to mongoldb connections (#15258)

* Add option to set a socket timeout for mongodb requests

* Handle mongodb timeouts better

* add default to config
This commit is contained in:
Phillip Thelen
2024-08-01 17:28:54 +02:00
parent 7aeec2e8eb
commit 33a696be4d
5 changed files with 29 additions and 0 deletions
+8
View File
@@ -60,6 +60,14 @@ export class TooManyRequests extends CustomError {
}
}
export class RequestTimeout extends CustomError {
constructor (customMessage) {
super();
this.name = this.constructor.name;
this.httpCode = 408;
this.message = customMessage || 'The request timed out.';
}
}
export class NotImplementedError extends CustomError {
constructor (str) {
super();