MCPcopy Create free account
hub / github.com/Effect-TS/effect / fail

Function fail

packages/sql/pg/src/PgConnection.ts:2452–2459  ·  view source on GitHub ↗
(reason: SqlErrorReason, type: ConnectFailureType, sqlState?: string)

Source from the content-addressed store, hash-verified

2450 let secretKey = 0
2451
2452 const fail = (reason: SqlErrorReason, type: ConnectFailureType, sqlState?: string): void => {
2453 if (done) return
2454 done = true
2455 failure.type = type
2456 failure.sqlState = sqlState
2457 socket?.destroy()
2458 resume(Effect.fail(new SqlError({ reason })))
2459 }
2460 const failConnect = (cause: unknown, message: string, type: ConnectFailureType = "other"): void =>
2461 fail(new ConnectionError({ cause, message, operation: "connect" }), type)
2462 const failAuth = (cause: unknown, message: string): void =>

Callers 3

failConnectFunction · 0.70
failAuthFunction · 0.70
failErrorResponseFunction · 0.70

Calls 3

failMethod · 0.65
resumeFunction · 0.50
destroyMethod · 0.45

Tested by

no test coverage detected