Fix #3868 postgres monitor could possibly crash Uptime Kuma (#3880)

* Bump pg

* Handle uncaughtException

* Fix parsing issue of postgres connection and fix the query example
This commit is contained in:
Louis Lam 2023-10-13 02:50:10 +08:00 committed by GitHub
parent c3e3f27457
commit 1c13a75970
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 20 deletions

View file

@ -1887,8 +1887,10 @@ gracefulShutdown(server.httpServer, {
});
// Catch unexpected errors here
process.addListener("unhandledRejection", (error, promise) => {
let unexpectedErrorHandler = (error, promise) => {
console.trace(error);
UptimeKumaServer.errorLog(error, false);
console.error("If you keep encountering errors, please report to https://github.com/louislam/uptime-kuma/issues");
});
};
process.addListener("unhandledRejection", unexpectedErrorHandler);
process.addListener("uncaughtException", unexpectedErrorHandler);