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

Function matchesSqliteNumericCode

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

Source from the content-addressed store, hash-verified

505}
506
507const matchesSqliteNumericCode = (cause: unknown, expected: number): boolean => {
508 const code = sqliteCodeFromCause(cause)
509 if (code === expected) {
510 return true
511 }
512 if (!Predicate.hasProperty(cause, "errno")) {
513 return false
514 }
515 return cause.errno === expected
516}
517
518const matchesSqliteCode = (code: string, expected: string): boolean =>
519 code === expected || code.startsWith(expected + "_")

Callers 1

classifySqliteErrorFunction · 0.85

Calls 1

sqliteCodeFromCauseFunction · 0.85

Tested by

no test coverage detected