Properly handle errors
This commit is contained in:
@ -32,7 +32,13 @@ namespace Hcs.Client.Api.Request.DeviceMetering
|
|||||||
throw RemoteException.CreateNew(error.ErrorCode, error.Description);
|
throw RemoteException.CreateNew(error.ErrorCode, error.Description);
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Проверить содержимое ответа
|
result.Items.OfType<CommonResultType>().ToList().ForEach(commonResult =>
|
||||||
|
{
|
||||||
|
commonResult.Items.OfType<ErrorMessageType>().ToList().ForEach(error =>
|
||||||
|
{
|
||||||
|
throw RemoteException.CreateNew(error.ErrorCode, error.Description);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user