Error Handling In Blazor Web Server Application

Ronald Rex 1,671 Reputation points
2022-07-31T18:51:39.13+00:00

I am calling a web API endpoint from my Blazor server application. And I intentionally have not started the application (.Net Core 6 Web Api) with the api service. Meaning, there is no service listening on the specified port. And I was wondering what is the best practice for handling this error. I am assuming it will be handled on the server hosting the api service which will send a message back to my blazor application? Thanks !!! Actually I just thought of something. How can my service return an error message if its not running. So I would have to code for this exception on the client or blazor server end?

226507-blazer-server-app-code.png

226523-net-core-6-web-api-code.png

Developer technologies | .NET | Blazor
Developer technologies | ASP.NET | ASP.NET API
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.