@prisma/language-server
Version:
Prisma Language Server
17 lines • 585 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isWasmPanic = isWasmPanic;
exports.getWasmError = getWasmError;
/**
* Returns true if the given error is a Wasm panic.
*/
function isWasmPanic(error) {
return error.name === 'RuntimeError';
}
function getWasmError(error) {
const globalWithWasm = globalThis;
const message = globalWithWasm.PRISMA_WASM_PANIC_REGISTRY.get();
const stack = [message, ...(error.stack || 'NO_BACKTRACE').split('\n').slice(1)].join('\n');
return { message, stack };
}
//# sourceMappingURL=panic.js.map