MCPcopy Index your code
hub / github.com/electric-sql/pglite / handleError

Method handleError

packages/pglite-socket/src/index.ts:209–223  ·  view source on GitHub ↗

* Handle errors from the socket

(err: Error)

Source from the content-addressed store, hash-verified

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

Callers 2

attachMethod · 0.95
handleDataMethod · 0.95

Calls 2

logMethod · 0.95
detachMethod · 0.95

Tested by

no test coverage detected