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:
@ -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))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user