diff --git a/src/plugins/vis_type_timeseries/server/routes/vis.ts b/src/plugins/vis_type_timeseries/server/routes/vis.ts index 8eede308d2cd7..1ae6aa025eb6a 100644 --- a/src/plugins/vis_type_timeseries/server/routes/vis.ts +++ b/src/plugins/vis_type_timeseries/server/routes/vis.ts @@ -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();