Properly handle errors

This commit is contained in:
2025-09-10 17:33:02 +09:00
parent bce9f7327e
commit a6016c76b8

View File

@ -32,7 +32,13 @@ namespace Hcs.Client.Api.Request.DeviceMetering
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;
}