added support for parsing error messages in odata format
This commit is contained in:
Родитель
a161599af9
Коммит
9a29e1cf77
|
@ -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];
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче