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

Function sqliteCauseWithErrno

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

Source from the content-addressed store, hash-verified

418 classifySqliteError(sqliteCauseWithErrno(cause), { message, operation })
419
420const sqliteCauseWithErrno = (cause: unknown): unknown => {
421 if (typeof cause !== "object" || cause === null || !("errcode" in cause) || "errno" in cause) {
422 return cause
423 }
424 const errcode = (cause as { readonly errcode: unknown }).errcode
425 if (typeof errcode !== "number") {
426 return cause
427 }
428 return Object.assign(cause, { errno: errcode })
429}
430
431// Deno's node:sqlite has no `enableLoadExtension`, so `allowExtension` alone
432// controls extension loading there.

Callers 1

classifyErrorFunction · 0.85

Calls 1

assignMethod · 0.80

Tested by

no test coverage detected