File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
packages/core/framework/src/http/middlewares Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1+ import { ErrorRequestHandler , NextFunction , Response } from "express"
12import { fromZodIssue } from "zod-validation-error"
2- import { NextFunction , ErrorRequestHandler , Response } from "express"
33
44import { ContainerRegistrationKeys , MedusaError } from "@medusajs/utils"
5- import { formatException } from "./exception-formatter"
65import { MedusaRequest } from "../types"
6+ import { formatException } from "./exception-formatter"
77
88const QUERY_RUNNER_RELEASED = "QueryRunnerAlreadyReleasedError"
99const TRANSACTION_STARTED = "TransactionAlreadyStartedError"
@@ -31,7 +31,6 @@ export function errorHandler() {
3131 }
3232
3333 err = formatException ( err )
34- logger . error ( err )
3534
3635 const errorType = err . type || err . name
3736 const errObj = {
@@ -82,6 +81,10 @@ export function errorHandler() {
8281 break
8382 }
8483
84+ if ( statusCode >= 500 ) {
85+ logger . error ( err )
86+ }
87+
8588 if ( "issues" in err && Array . isArray ( err . issues ) ) {
8689 const messages = err . issues . map ( ( issue ) => fromZodIssue ( issue ) . toString ( ) )
8790 res . status ( statusCode ) . json ( {
You can’t perform that action at this time.
0 commit comments