Check import results
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
using Hcs.Client.Api.Request;
|
||||
using Hcs.Client.Api.Request.Adapter;
|
||||
using Hcs.Client.Api.Request.Exception;
|
||||
using Hcs.Service.Async.HouseManagement;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Hcs.Service.Async.HouseManagement
|
||||
@ -51,5 +54,29 @@ namespace Hcs.Client.Api.Request.HouseManagement
|
||||
protected override bool CanBeRestarted => true;
|
||||
|
||||
protected override int RestartTimeoutMinutes => 20;
|
||||
|
||||
protected getStateResultImportResultCommonResult[] GetCommonResults(IEnumerable<getStateResultImportResult> importResults)
|
||||
{
|
||||
var result = new List<getStateResultImportResultCommonResult>();
|
||||
foreach (var importResult in importResults)
|
||||
{
|
||||
importResult.Items.OfType<ErrorMessageType>().ToList().ForEach(error =>
|
||||
{
|
||||
throw RemoteException.CreateNew(error.ErrorCode, error.Description);
|
||||
});
|
||||
|
||||
var commonResults = importResult.Items.OfType<getStateResultImportResultCommonResult>();
|
||||
foreach (var commonResult in commonResults)
|
||||
{
|
||||
commonResult.Items.OfType<CommonResultTypeError>().ToList().ForEach(error =>
|
||||
{
|
||||
throw RemoteException.CreateNew(error.ErrorCode, error.Description);
|
||||
});
|
||||
}
|
||||
|
||||
result.AddRange(commonResults);
|
||||
}
|
||||
return [.. result];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user