How to handle the error when the external api failed due to internet disconnected

Ramesh P 0 Reputation points
2023-01-17T12:50:59.18+00:00

Actually I had develop the blazor webassembly application

In this application when the externalapi failed due to internet disconnected

at the time on blazor application UI shows the error like "One or more error

occured". whenever I had checked the error using inspect on browser

that is called "Failed load resource: :net:ERR_INTERNET_DISCONNECTED"

catch block not helpful for caught the exception or error because when

execution point came to the external api line at the time I got the error on

browser due to internet disconnected

I want to handle this error and need to show the custom message if internet

disconnected

please help me. Thanks

catch block not helpful for caught the exception or error because when

execution point came to the external api line at the time I got the error on

browser due to internet disconnected

I want to handle this error and need to show the custom message if internet

disconnected

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,382 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,222 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 55,366 Reputation points
    2023-01-18T20:45:07.2166667+00:00

    see this article

    [https://code-maze.com/global-http-error-handling-in-blazor-webassembly/

    0 comments No comments