Skip to content

Commit

Permalink
Merge pull request #2153 from bcgov/feature/yup-logging
Browse files Browse the repository at this point in the history
Changes to log yup validation.
  • Loading branch information
arcshiftsolutions authored Dec 17, 2024
2 parents 52ad76f + d5e273a commit 9d70947
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/src/components/validator.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';
const log = require('../components/logger');
const validate = (schema) => async (req, res, next) => {
try {
await schema.validate({
Expand All @@ -9,6 +11,7 @@ const validate = (schema) => async (req, res, next) => {
});
next();
} catch (e) {
log.error('Error running schema validation .', e);
return res.status(400).send(e.message);
}
};
Expand Down

0 comments on commit 9d70947

Please sign in to comment.