10

Handling Errors in Blazor WebAssembly

You are working hard on the client side, you have built an amazing app that does everything perfectly, the UI is great, your app is fetching and sending data from and to the API correctly, and everyone is happy. But what if the API, for some reason, is taking too long to process requests, so your app loads for around 30 seconds, then a yellow bar appears at the bottom, indicating that an unhandled exception occurred? That’s an experience that neither the user nor the developer would like to have.

Errors and exceptions can occur for many reasons and in many parts of an app. The goal of this chapter is to learn the techniques to handle them properly and give users a better experience. We will start by explaining ...

Get Mastering Blazor WebAssembly now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.