Open williammendat opened 2 years ago
Sorry, Xmas.
On the surface, that sounds ... honestly, impossible. Can I just confirm: we're saying that ex
in the catch
is null
? If so: which of the two catch
? I wonder if this is a WASM peculiarity, and WASM doesn't enforce quite the same runtime rules on exceptions that we now expect.
Sooo now sorry for the late answer....
Yes the Exception is null in
catch (RpcException ex)
{
Console.WriteLine(ex);
}
It is also interessting that in the second catch block the Exception is not null but i cant really work with the informations from there.
I wanted to make an example project but i couldnt get it working quickly, so i prepared an old project with grpc code first.
Because its an old project, there is unnessary code for this issue.
The focus is in the "Person" page, there is a button "Test gRPC" which calls a grpc method where an RpcException is thrown.
To get this project run you have to first start the API project, then the client.
After starting the Client, it will start with a login page. There i have it modified, that you can just login with out typing anything.
The project can be found here: https://github.com/Madara789/BlazorYoutubeDl
Hey @williammendat did you have any result with this issue? I'm seeing a similar thing:
Also in Blazor WASM
Edit:
Ok with a Console.WriteLine(ex.ToString());
I do see the error in the browser console:
Grpc.Core.RpcException: Status(StatusCode="Cancelled", Detail="Bad gRPC response. Invalid content-type value: text/html; charset=utf-8")
I guess this is just some Visual Studio WASM Debugger link issue.
Hello, and sorry that i am making an issue for that...
I am currently working on a Blazor WASM project with grpc web code first approach. Everything seems to work at this point but when it comes to exception handling, the exception on the client side to handle it, is always null. I dont know, maybe i messed up the configuration or something...
Here is my code:
ServerLoggerInterceptor:
Server Startup:
Server Methode:
Client Methode:
Note: I am getting in the catch block but "ex" is null.