MCPcopy
hub / github.com/prisma/prisma / convertDriverError

Function convertDriverError

packages/adapter-ppg/src/errors.ts:4–14  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

2import { DatabaseError } from '@prisma/ppg'
3
4export function convertDriverError(error: unknown): DriverAdapterErrorObject {
5 if (isDriverError(error)) {
6 return {
7 originalCode: error.code,
8 originalMessage: error.message,
9 ...mapDriverError(error),
10 }
11 }
12
13 throw error
14}
15
16function mapDriverError(error: DatabaseError): MappedError {
17 switch (error.code) {

Callers 5

#ensureBegunMethod · 0.90
commitMethod · 0.90
rollbackMethod · 0.90
executeQueryRawFunction · 0.90
executeRawStatementFunction · 0.90

Calls 2

isDriverErrorFunction · 0.70
mapDriverErrorFunction · 0.70

Tested by

no test coverage detected