prevent database error from crashing server

This commit is contained in:
Philipinho
2024-07-05 18:59:16 +01:00
parent ce6a05ab66
commit 9496ec9b57

View File

@ -36,6 +36,8 @@ types.setTypeParser(types.builtins.INT8, (val) => Number(val));
dialect: new PostgresDialect({ dialect: new PostgresDialect({
pool: new Pool({ pool: new Pool({
connectionString: environmentService.getDatabaseURL(), connectionString: environmentService.getDatabaseURL(),
}).on('error', (err) => {
console.error('Database error:', err.message);
}), }),
}), }),
plugins: [new CamelCasePlugin()], plugins: [new CamelCasePlugin()],