* Handle errors from the socket
(err: Error)
| 207 | * Handle errors from the socket |
| 208 | */ |
| 209 | private handleError(err: Error): void { |
| 210 | this.log(`handleError:`, err) |
| 211 | |
| 212 | // Emit error event |
| 213 | this.dispatchEvent(new CustomEvent('error', { detail: err })) |
| 214 | |
| 215 | // Reject the lock on the PGlite instance |
| 216 | this.log(`handleError: rejecting exclusive lock on PGlite instance`) |
| 217 | this.rejectLock?.(err) |
| 218 | this.resolveLock = undefined |
| 219 | this.rejectLock = undefined |
| 220 | |
| 221 | // Close the connection on error |
| 222 | this.detach(true) |
| 223 | } |
| 224 | |
| 225 | /** |
| 226 | * Handle socket close event |
no test coverage detected