(conn: Connection, error: TransportError)
| 808 | ) |
| 809 | |
| 810 | const lose = (conn: Connection, error: TransportError) => { |
| 811 | if (conn.error !== undefined) return |
| 812 | conn.error = error |
| 813 | if (connection === conn) connection = undefined |
| 814 | Deferred.doneUnsafe(conn.ack, Effect.fail(error)) |
| 815 | for (const [id, operation] of operations) { |
| 816 | if (operation.connection !== conn) continue |
| 817 | operations.delete(id) |
| 818 | Queue.failCauseUnsafe(operation.queue, Cause.fail(error)) |
| 819 | } |
| 820 | } |
| 821 | |
| 822 | // An invalid server message closes the connection with 4400, which is |
| 823 | // fatal for every operation on it. |
no test coverage detected