From 9ec5d90caf568920fda760457479a470c300d1e1 Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Tue, 26 Sep 2017 10:21:50 -0700 Subject: [PATCH] Fixes #14171 - Handle boom errors properly for vis data requests (#14174) --- src/core_plugins/metrics/server/routes/vis.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core_plugins/metrics/server/routes/vis.js b/src/core_plugins/metrics/server/routes/vis.js index b0b2fe1cf3691..bb32626d74d24 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)); }); } });