fix: handle postgres.js connection timeouts (#1424)

This commit is contained in:
Rafael Cárdenas
2022-11-08 14:23:56 -06:00
committed by GitHub
parent b8e79c81b1
commit 4a2a342b56

View File

@@ -192,6 +192,8 @@ export function isPgConnectionError(error: any): string | false {
return 'Postgres connection CONNECTION_DESTROYED';
} else if (error.code === 'CONNECTION_CONNECT_TIMEOUT') {
return 'Postgres connection CONNECTION_CONNECT_TIMEOUT';
} else if (error.code === 'CONNECT_TIMEOUT') {
return 'Postgres connection CONNECT_TIMEOUT';
} else if (error.message) {
const msg = (error as Error).message.toLowerCase();
if (msg.includes('database system is starting up')) {