Simplify failure handling
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user