(err: any, e: pgPromise.IEventContext)
| 18 | // see https://stackoverflow.com/questions/36120435/verify-database-connection-with-pg-promise-when-starting-an-app |
| 19 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 20 | async error(err: any, e: pgPromise.IEventContext): Promise<void> { |
| 21 | if (e.cn) { |
| 22 | if (log !== undefined) log.fatal(err, { cn: e.cn }, 'DB connection error. Stopping process') |
| 23 | // logs don't have flush: |
| 24 | await new Promise((resolve) => setTimeout(resolve, 100)) |
| 25 | process.nextTick(() => process.exit()) |
| 26 | } |
| 27 | }, |
| 28 | }) |
| 29 | |
| 30 | // timestamp |
nothing calls this directly
no outgoing calls
no test coverage detected