diff --git a/lib/common/lib/services/serviceclient.js b/lib/common/lib/services/serviceclient.js index 75ca70bfb..aeb721224 100644 --- a/lib/common/lib/services/serviceclient.js +++ b/lib/common/lib/services/serviceclient.js @@ -753,12 +753,15 @@ ServiceClient._normalizeError = function (error, response) { } else if (error) { var normalizedError = {}; - var errorProperties = error.Error || error.error || error; + var odataErrorFormat = error['odata.error'] ? 1 : 0; + var errorProperties = error.Error || error.error || error['odata.error'] || error; for (var property in errorProperties) { if (property !== Constants.XML_METADATA_MARKER) { var value = null; if (errorProperties[property] && errorProperties[property][Constants.XML_VALUE_MARKER]) { value = errorProperties[property][Constants.XML_VALUE_MARKER]; + } else if (odataErrorFormat && property === 'message' && !azureutil.objectIsString(errorProperties[property])) { + value = errorProperties[property]['value']; } else { value = errorProperties[property]; }