(error: SqlError, destroySocket = true)
| 649 | } |
| 650 | |
| 651 | fatal(error: SqlError, destroySocket = true): void { |
| 652 | if (this.deadWith !== undefined) return |
| 653 | this.deadWith = error |
| 654 | if (destroySocket) this.session.socket.destroy() |
| 655 | const consumer = this.consumer |
| 656 | this.consumer = undefined |
| 657 | if (!this.closed) { |
| 658 | for (const hook of this.retireHooks) hook() |
| 659 | } |
| 660 | consumer?.onFatal(error) |
| 661 | const sets = Array.from(this.channels.values()) |
| 662 | this.channels.clear() |
| 663 | const cause = this.closed ? Cause.interrupt() : Cause.fail(error) |
| 664 | for (const set of sets) { |
| 665 | for (const queue of set) Queue.failCauseUnsafe(queue, cause) |
| 666 | } |
| 667 | } |
| 668 | |
| 669 | closeUnsafe(): void { |
| 670 | this.closed = true |
no test coverage detected