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.
This commit is contained in:
Markus Mäkelä
2017-07-17 16:32:33 +03:00
parent 64c5d6d610
commit f9e161eaf6

View File

@ -181,6 +181,8 @@ module.exports = function() {
logError(JSON.stringify(err.response.body, null, 4)) logError(JSON.stringify(err.response.body, null, 4))
} else if (err.statusCode) { } else if (err.statusCode) {
logError('Server responded with ' + err.statusCode) logError('Server responded with ' + err.statusCode)
} else if (err.error) {
logError(JSON.stringify(err.error, null, 4))
} else { } else {
logError('Undefined error: ' + JSON.stringify(err, null, 4)) logError('Undefined error: ' + JSON.stringify(err, null, 4))
} }