@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 CHANGED
@@ -46243,6 +46243,12 @@ var require_errorMiddleware = __commonJS({
46243
46243
  err: error.error,
46244
46244
  message: message2
46245
46245
  });
46246
+ } else if ((error === null || error === void 0 ? void 0 : error.name) === "ValidateError") {
46247
+ req.log.error(`Caught validation error for ${req.path}:`, error.fields);
46248
+ return res.status(error.status).json({
46249
+ message: "Validation failed",
46250
+ details: error === null || error === void 0 ? void 0 : error.fields
46251
+ });
46246
46252
  } else if (error instanceof Error) {
46247
46253
  req.log.error({ error, message: message2 });
46248
46254
  } else {