Various error log improvements #100
1 changed files with 7 additions and 0 deletions
Log failed m2d error reports
Whenever `sendError` fails (the function responsible for sending reports about failed m2d bridging back to the matrix room), the error was silently dropped. We now log it as an error to the console.
commit
8e9458d41c
|
|
@ -128,7 +128,14 @@ async function sendError(roomID, source, type, e, payload) {
|
||||||
|| (e instanceof mreq.MatrixServerError && [502, 503].includes(e.httpStatus) && e.errcode === "CX_SERVER_ERROR")
|
|| (e instanceof mreq.MatrixServerError && [502, 503].includes(e.httpStatus) && e.errcode === "CX_SERVER_ERROR")
|
||||||
) {
|
) {
|
||||||
// Matrix homeserver is down (reverse proxy indicated failure)
|
// Matrix homeserver is down (reverse proxy indicated failure)
|
||||||
|
console.error([
|
||||||
|
`Matrix homeserver is down, queueing ${type} ${source} event.`,
|
||||||
|
`Couldn't send error report to ${roomID}:`,
|
||||||
|
util.inspect(e, false, 4, false),
|
||||||
|
].join("\n"))
|
||||||
homeserverStatus.homeserverStatus.setErrorWithPacket([source, payload])
|
homeserverStatus.homeserverStatus.setErrorWithPacket([source, payload])
|
||||||
|
} else {
|
||||||
|
console.error(`Couldn't send error report for a ${type} ${source} event to ${roomID}:\n${util.inspect(e, false, 4, false)}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue