Simplify failure handling

This commit is contained in:
2025-11-01 19:28:20 +09:00
parent 821eeb41ae
commit 737e581f75
5 changed files with 19 additions and 21 deletions

View File

@ -6,12 +6,12 @@ namespace Hcs.WebApp.BackgroundServices.ResultGetters.NsiCommon
{
public class ExportNsiItemGetter_15_7_0_1(IClient client, IServiceScope scope, Operation operation) : ResultGetterBase(client, scope, operation)
{
public override async Task<ResultGetterResponse> GetAsync()
public override async Task<bool> GetAsync()
{
var result = await client.NsiCommon.GetExportNsiItemResultAsync(operation.MessageGuid!);
if (!result.Ready)
{
return ResultGetterResponse.NotReady;
return false;
}
if (result.Success)
@ -20,10 +20,10 @@ namespace Hcs.WebApp.BackgroundServices.ResultGetters.NsiCommon
var registry = await registryService.GetRegistryByOperationIdAsync(operation.Id);
// TODO
return ResultGetterResponse.Successful;
return true;
}
return ResultGetterResponse.Failed;
throw Failure(result.ErrorMessage);
}
}
}