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

Function onError

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

Source from the content-addressed store, hash-verified

358 }
359
360 function onError(cause: Event) {
361 const exit = Exit.fail(
362 new SqlError({ reason: classifyError(cause, "SQLite WASM worker failed", "worker") })
363 )
364 const requests = Array.from(pending.values())
365 pending.clear()
366 for (const resume of requests) {
367 resume(exit)
368 }
369 Effect.runFork(ScopedRef.set(connectionRef, makeConnection))
370 }
371 if ("onerror" in worker) {
372 worker.addEventListener("error", onError)
373 }

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected