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

Function sqliteCauseWithErrno

packages/sql/sqlite-node/src/SqliteClient.ts:380–389  ·  view source on GitHub ↗
(cause: unknown)

Source from the content-addressed store, hash-verified

378 classifySqliteError(sqliteCauseWithErrno(cause), { message, operation })
379
380const sqliteCauseWithErrno = (cause: unknown): unknown => {
381 if (typeof cause !== "object" || cause === null || !("errcode" in cause) || "errno" in cause) {
382 return cause
383 }
384 const errcode = (cause as { readonly errcode: unknown }).errcode
385 if (typeof errcode !== "number") {
386 return cause
387 }
388 return Object.assign(cause, { errno: errcode })
389}

Callers 1

classifyErrorFunction · 0.85

Calls 1

assignMethod · 0.80

Tested by

no test coverage detected