MCPcopy
hub / github.com/prisma/prisma / handleGetDmmfResult

Function handleGetDmmfResult

packages/internals/src/engine-commands/getDmmf.ts:62–76  ·  view source on GitHub ↗
(result: ReturnType<typeof getDMMFRaw>)

Source from the content-addressed store, hash-verified

60}
61
62function handleGetDmmfResult(result: ReturnType<typeof getDMMFRaw>): DMMF.Document {
63 if ('error' in result) {
64 debugErrorType(result)
65 switch (result.type) {
66 case 'wasm-error':
67 throw mapWasmPanicToGetDmmfError(result.error, result.reason)
68 case 'parse-json':
69 throw new GetDmmfError({ _tag: 'unparsed', message: result.error.message, reason: result.reason })
70 default:
71 assertNever(result.type, 'Unknown getDmmf error type')
72 }
73 } else {
74 return result
75 }
76}
77
78function mapWasmPanicToGetDmmfError(error: Error | WasmPanic, reason: string): GetDmmfError {
79 /**

Callers 2

getDMMFFunction · 0.85
getInternalDMMFFunction · 0.85

Calls 2

assertNeverFunction · 0.90

Tested by

no test coverage detected