@squiz/render-runtime-lib 1.2.1-alpha.97 → 1.2.1-alpha.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -1
- package/lib/worker/worker-root.js +6 -0
- package/lib/worker/worker-root.js.map +1 -1
- package/package.json +5 -5
|
@@ -23396,6 +23396,12 @@ var require_errorMiddleware = __commonJS({
|
|
|
23396
23396
|
err: error.error,
|
|
23397
23397
|
message
|
|
23398
23398
|
});
|
|
23399
|
+
} else if ((error === null || error === void 0 ? void 0 : error.name) === "ValidateError") {
|
|
23400
|
+
req.log.error(`Caught validation error for ${req.path}:`, error.fields);
|
|
23401
|
+
return res.status(error.status).json({
|
|
23402
|
+
message: "Validation failed",
|
|
23403
|
+
details: error === null || error === void 0 ? void 0 : error.fields
|
|
23404
|
+
});
|
|
23399
23405
|
} else if (error instanceof Error) {
|
|
23400
23406
|
req.log.error({ error, message });
|
|
23401
23407
|
} else {
|