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
committed by GitHub
parent 7f6ae8ffbf
commit 15f104ddd0
5 changed files with 29 additions and 0 deletions

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();