Error Handling In Blazor Web Server Application

Ronald Rex 1,666 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

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,396 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
299 questions
{count} votes