UNPKG

prisma-error-formatter

Version:

A flexible and customizable Prisma error formatter to simplify and unify error handling in Prisma Client applications.

15 lines (14 loc) 528 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatUnknownError = formatUnknownError; function formatUnknownError(exception) { const path = typeof (exception === null || exception === void 0 ? void 0 : exception.name) === "string" ? exception.name.toLowerCase() : "internal"; return [ { path, message: (exception === null || exception === void 0 ? void 0 : exception.message) || "An unexpected error occurred.", }, ]; }