Skip to content

Commit

Permalink
apply feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmrdavid authored Apr 5, 2024
1 parent 1dc5dae commit eb85ff2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/WebJobs.Extensions.DurableTask/LocalGrpcListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,18 @@ public override Task<Empty> Hello(Empty request, ServerCallContext context)
InstanceId = instanceId,
};
}
catch (InvalidOperationException ex)
catch (OrchestrationAlreadyExistsException ex)
{
string errorMessage = $"Failed to start instance with ID {request.InstanceId}. Does this instance ID already exist?.\n" +
$"Inner exception: {ex}";
throw new RpcException(new Status(StatusCode.AlreadyExists, errorMessage));
throw new RpcException(new Status(StatusCode.AlreadyExists, $"An Orchestration instance with the ID {request.InstanceId} already exists."));
}
catch (Exception ex)
{
this.extension.TraceHelper.ExtensionWarningEvent(
this.extension.Options.HubName,
functionName: request.Name,
instanceId: request.InstanceId,
message: $"Failed to start instanceId {request.InstanceId} due to internal exception.\n Exception trace: {ex}.");
throw new RpcException(new Status(StatusCode.Internal, $"Failed to start instance with ID {request.InstanceId}. Does this instance ID already exist?.\n"));
}
}

Expand Down

0 comments on commit eb85ff2

Please sign in to comment.