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

Function matchesSqliteNumericCode

packages/effect/src/unstable/sql/SqlError.ts:464–473  ·  view source on GitHub ↗
(cause: unknown, expected: number)

Source from the content-addressed store, hash-verified

462}
463
464const matchesSqliteNumericCode = (cause: unknown, expected: number): boolean => {
465 const code = sqliteCodeFromCause(cause)
466 if (code === expected) {
467 return true
468 }
469 if (!Predicate.hasProperty(cause, "errno")) {
470 return false
471 }
472 return cause.errno === expected
473}
474
475const matchesSqliteCode = (code: string, expected: string): boolean =>
476 code === expected || code.startsWith(expected + "_")

Callers 1

classifySqliteErrorFunction · 0.85

Calls 1

sqliteCodeFromCauseFunction · 0.85

Tested by

no test coverage detected