Reader small image

You're reading from  Mastering Blazor WebAssembly

Product typeBook
Published inAug 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781803235103
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Ahmad Mozaffar
Ahmad Mozaffar
author image
Ahmad Mozaffar

Ahmad Mozaff ar is a senior soft ware engineer, cloud developer, and trainer who currently works at ContraForce as a senior full stack engineer responsible for developing SaaS platforms using Blazor, Azure, AI, and other modern technologies. Originally from Syria, his passion for soft ware development, especially .NET and Azure, started at a very early age. He loves teaching people about developing soft ware using .NET, Azure, and other Microsoft technologies through his YouTube channel, AK Academy, and writing articles on multiple platforms, which have reached more than 400K readers.
Read more about Ahmad Mozaffar

Right arrow

Utilizing the ErrorBoundary component

In .NET 6.0, Blazor got a new component called ErrorBoundary. This component is very simple, easy to use, and powerful at the same time. The ErrorBoundary component handles any exceptions that occur during the rendering of a child component and displays a custom UI in place of the faulty component.

The ErrorBoundary component accepts two RenderFragement parameters: one called ChildContent, which represents the UI of the child components when no errors occur, and another called ErrorContent, which represents the content when an error occurs.

For example, when you use Twitter with a poor internet connection, you may see that the tweet details load successfully, but the replies below the tweet display an error message such as Failed to load the replies with a Retry button. This experience can be achieved with the ErrorBoundary component, but you need to keep in mind that the exception you need to handle with the ErrorBoundary error UI must not...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering Blazor WebAssembly
Published in: Aug 2023Publisher: PacktISBN-13: 9781803235103

Author (1)

author image
Ahmad Mozaffar

Ahmad Mozaff ar is a senior soft ware engineer, cloud developer, and trainer who currently works at ContraForce as a senior full stack engineer responsible for developing SaaS platforms using Blazor, Azure, AI, and other modern technologies. Originally from Syria, his passion for soft ware development, especially .NET and Azure, started at a very early age. He loves teaching people about developing soft ware using .NET, Azure, and other Microsoft technologies through his YouTube channel, AK Academy, and writing articles on multiple platforms, which have reached more than 400K readers.
Read more about Ahmad Mozaffar