diff --git a/src/core_plugins/metrics/server/routes/vis.js b/src/core_plugins/metrics/server/routes/vis.js index b0b2fe1cf369..bb32626d74d2 100644 --- a/src/core_plugins/metrics/server/routes/vis.js +++ b/src/core_plugins/metrics/server/routes/vis.js @@ -9,7 +9,8 @@ export default (server) => { getVisData(req) .then(reply) .catch(err => { - reply(Boom.wrap(err, 400)); + if (err.isBoom && err.status === 401) return reply(err); + reply(Boom.wrap(err, 500)); }); } });