fix: Capture non-error as error
This commit is contained in:
parent
82de234f21
commit
cd527f2bce
1 changed files with 3 additions and 0 deletions
|
|
@ -37,6 +37,9 @@ if (dev) {
|
||||||
export const prisma = new PrismaClient(prismaOptions);
|
export const prisma = new PrismaClient(prismaOptions);
|
||||||
|
|
||||||
export function PrismaErrorHandler(e) {
|
export function PrismaErrorHandler(e) {
|
||||||
|
if (e! instanceof Error) {
|
||||||
|
e = new Error(e.toString());
|
||||||
|
}
|
||||||
sentry.captureException(e);
|
sentry.captureException(e);
|
||||||
const payload = {
|
const payload = {
|
||||||
status: e.status || 500,
|
status: e.status || 500,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue