MCPcopy Create free account
hub / github.com/Effect-TS/effect / onError

Function onError

packages/sql/sqlite-wasm/src/SqliteClient.ts:347–357  ·  view source on GitHub ↗
(cause: Event)

Source from the content-addressed store, hash-verified

345 port.addEventListener("message", onMessage)
346
347 function onError(cause: Event) {
348 const exit = Exit.fail(
349 new SqlError({ reason: classifyError(cause, "SQLite WASM worker failed", "worker") })
350 )
351 const requests = Array.from(pending.values())
352 pending.clear()
353 for (const resume of requests) {
354 resume(exit)
355 }
356 Effect.runFork(ScopedRef.set(connectionRef, makeConnection))
357 }
358 if ("onerror" in worker) {
359 worker.addEventListener("error", onError)
360 }

Callers

nothing calls this directly

Calls 5

clearMethod · 0.80
classifyErrorFunction · 0.70
setMethod · 0.65
resumeFunction · 0.50
failMethod · 0.45

Tested by

no test coverage detected