(fields: PgProtocol.ErrorFields, message: string)
| 2462 | const failAuth = (cause: unknown, message: string): void => |
| 2463 | fail(new AuthenticationError({ cause, message, operation: "connect" }), "auth") |
| 2464 | const failErrorResponse = (fields: PgProtocol.ErrorFields, message: string): void => { |
| 2465 | const reason = classifyFields(fields, message, "connect") |
| 2466 | const code = fields.code |
| 2467 | fail( |
| 2468 | reason, |
| 2469 | reason._tag === "AuthenticationError" ? "auth" : "refused", |
| 2470 | code !== undefined && sqlStatePattern.test(code) ? code : undefined |
| 2471 | ) |
| 2472 | } |
| 2473 | |
| 2474 | const onError = (cause: Error) => failConnect(cause, "PgConnection: Failed to connect", "refused") |
| 2475 | const onClose = () => |
no test coverage detected