@adaptivestone/framework 3.0.1 → 3.0.2
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/CHANGELOG.md +4 -0
- package/modules/AbstractController.js +5 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -205,10 +205,12 @@ class AbstractController extends Base {
|
|
|
205
205
|
} catch (e) {
|
|
206
206
|
let { errors } = e;
|
|
207
207
|
// translate it
|
|
208
|
-
if (req.i18n) {
|
|
209
|
-
errors =
|
|
208
|
+
if (req.i18n && errors) {
|
|
209
|
+
errors = errors.map((err) => req.i18n.t(err));
|
|
210
210
|
}
|
|
211
|
-
this.logger.error(
|
|
211
|
+
this.logger.error(
|
|
212
|
+
`Request validation failed with message: ${e.message}. errors: ${errors}`,
|
|
213
|
+
);
|
|
212
214
|
|
|
213
215
|
return res.status(400).json({
|
|
214
216
|
errors: {
|