MCPcopy Index your code
hub / github.com/simstudioai/sim / getPostgresErrorCode

Function getPostgresErrorCode

packages/utils/src/errors.ts:29–31  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

27 * Normalizes common Drizzle / `postgres` driver shapes and walks `cause` chains.
28 */
29export function getPostgresErrorCode(error: unknown): string | undefined {
30 return readPgErrorField(error, 'code')
31}
32
33/**
34 * Returns the name of the PostgreSQL constraint that triggered the error (e.g. the unique index

Callers 15

isTransientConnectErrorFunction · 0.90
connectWithRetryFunction · 0.90
runMigrationsWithRetryFunction · 0.90
createTableFunction · 0.90
renameTableFunction · 0.90
restoreTableFunction · 0.90

Calls 1

readPgErrorFieldFunction · 0.85

Tested by

no test coverage detected