MCPcopy
hub / github.com/linuxfoundation/crowd.dev / error

Function error

services/libs/database/src/connection.ts:20–27  ·  view source on GitHub ↗
(err: any, e: pgPromise.IEventContext)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected