mjolnir
mjolnir copied to clipboard
Bot crashes on API timeout
Describe the bug
It seems the bot will crash itself when faced with a 504 timeout.
Wed, 19 Jan 2022 12:42:09 GMT [ERROR] [MatrixHttpClient (REQ-39)] <html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<IncomingMessage>".] {
code: 'ERR_UNHANDLED_REJECTION'
}
Expected behavior
Log the timeout but don't hard crash.
Version:
matrixdotorg/mjolnir:v1.2.1