-
Notifications
You must be signed in to change notification settings - Fork 361
Closed
Labels
Description
Expected Behavior
The client sdk should be able to handle HTTP 400 Bad Request and make the request available to the calling application
Actual Behavior
When the app returns a HTTP400 or BadRequest object the dapr client fails with an exception.
Steps to Reproduce the Problem
Small modification of https://github.com/dapr/dotnet-sdk/blob/master/samples/AspNetCore/ControllerSample/Controllers/SampleController.cs to add the following method
to return a BadRequest
/// Do
[HttpPost("do")]
public IActionResult Do(int value)
{
Console.WriteLine($"Doing {value}");
return BadRequest(new
{
value = value
});
}
When calling the method on the client via
var a = await client.InvokeMethodAsync<object, Account>("routing", "do", data, httpExtension);
we are getting an exception
== APP == DepositUsingServiceInvocation
== APP == invoking
== APP == Unhandled exception. Grpc.Core.RpcException: Status(StatusCode=Internal, Detail="Bad Request")
== APP == at Dapr.Client.DaprClientGrpc.MakeGrpcCallHandleError[TResponse](Func`2 callFunc, CancellationToken cancellationToken) in /dotnet-sdk/src/Dapr.Client/DaprClientGrpc.cs:line 585
It seems there is no handling in the client sdk https://github.com/dapr/dotnet-sdk/blob/master/src/Dapr.Client/DaprClientGrpc.cs#L584
RELEASE NOTE: N/A