(tryCb: () => T)
| 61 | } |
| 62 | |
| 63 | function handleFormatPanic<T>(tryCb: () => T) { |
| 64 | try { |
| 65 | return tryCb() |
| 66 | } catch (e: unknown) { |
| 67 | const { message, stack } = getWasmError(e as WasmPanic) |
| 68 | debug(`Error formatting schema: ${message}`) |
| 69 | debug(stack) |
| 70 | |
| 71 | const panic = new RustPanic( |
| 72 | /* message */ message, |
| 73 | /* rustStack */ stack, |
| 74 | /* request */ '@prisma/prisma-schema-wasm format', |
| 75 | ErrorArea.FMT_CLI, |
| 76 | ) |
| 77 | |
| 78 | throw panic |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | type DocumentUri = string |
| 83 |
no test coverage detected