MCPcopy
hub / github.com/prisma/prisma / main

Function main

packages/migrate/src/utils/test-handlePanic.ts:3–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { ErrorArea, handlePanic, RustPanic } from '@prisma/internals'
2
3async function main() {
4 const error = new RustPanic('Some error message!\n'.repeat(23), '', undefined, ErrorArea.LIFT_CLI)
5
6 const packageJsonVersion = '0.0.0'
7 const enginesVersion = 'prismaEngineVersionHash'
8 const getDatabaseVersionSafe = () => Promise.resolve(undefined)
9
10 await handlePanic({
11 error,
12 cliVersion: packageJsonVersion,
13 enginesVersion,
14 command: 'something-test',
15 getDatabaseVersionSafe,
16 })
17 .catch((e) => {
18 console.log(e)
19 })
20 .finally(() => {
21 process.exit(1)
22 })
23}
24
25void main()

Callers 1

Calls 4

handlePanicFunction · 0.90
finallyMethod · 0.80
catchMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected