Skip to content

Commit

Permalink
Replace logging failed in validateObject validation with 400 error
Browse files Browse the repository at this point in the history
  • Loading branch information
DianaDerevyankina committed Dec 17, 2020
1 parent e773319 commit 679417c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/plugins/vis_type_timeseries/server/routes/vis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ export const visDataRoutes = (
async (requestContext, request, response) => {
try {
validateObject(request.body);
} catch (error) {
return response.badRequest({
body: error.message,
});
}

try {
visPayloadSchema.validate(request.body);
} catch (error) {
logFailedValidation();
Expand Down

0 comments on commit 679417c

Please sign in to comment.