MCPcopy Create free account
hub / github.com/InsForge/InsForge / hasPgErrorCode

Function hasPgErrorCode

backend/src/utils/errors.ts:134–136  ·  view source on GitHub ↗
(error: unknown, code: string)

Source from the content-addressed store, hash-verified

132}
133
134export function hasPgErrorCode(error: unknown, code: string): error is PgErrorLike {
135 return isPgErrorLike(error) && error.code === code;
136}
137
138export function getDatabaseErrorDetails(err: DatabaseError): ErrorResponseDetails | null {
139 if (err.code && POSTGRES_ERROR_HANDLERS[err.code]) {

Callers 3

executeRawSQLMethod · 0.85
runScanAsyncMethod · 0.85
createFunctionMethod · 0.85

Calls 1

isPgErrorLikeFunction · 0.85

Tested by

no test coverage detected