From f9e161eaf6881f9feb0cfd3cde9e1a81e27dfec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 17 Jul 2017 16:32:33 +0300 Subject: [PATCH] MXS-1300: Add finer granularity to error message content If an unexpected network error occurs, only the error part of the response should be printed. The complete object should be dumped only as a last resort. --- maxctrl/maxctrl_core/common.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/maxctrl/maxctrl_core/common.js b/maxctrl/maxctrl_core/common.js index d4015f7a4..43f73cc7d 100644 --- a/maxctrl/maxctrl_core/common.js +++ b/maxctrl/maxctrl_core/common.js @@ -181,6 +181,8 @@ module.exports = function() { logError(JSON.stringify(err.response.body, null, 4)) } else if (err.statusCode) { logError('Server responded with ' + err.statusCode) + } else if (err.error) { + logError(JSON.stringify(err.error, null, 4)) } else { logError('Undefined error: ' + JSON.stringify(err, null, 4)) }