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

Function convertDriverError

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

Source from the content-addressed store, hash-verified

2import type { SqlError } from 'mariadb'
3
4export function convertDriverError(error: unknown): DriverAdapterErrorObject {
5 if (isDriverError(error)) {
6 return {
7 originalCode: error.errno.toString(),
8 originalMessage: error.sqlMessage ?? 'N/A',
9 ...mapDriverError(error),
10 }
11 }
12
13 throw error
14}
15
16export function mapDriverError(error: DriverError): MappedError {
17 switch (error.errno) {

Callers 2

onErrorMethod · 0.90
errors.test.tsFile · 0.90

Calls 3

isDriverErrorFunction · 0.70
mapDriverErrorFunction · 0.70
toStringMethod · 0.45

Tested by

no test coverage detected