-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add architecture decision record for implementing error boundaries
- Loading branch information
1 parent
1143621
commit 67f9534
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Error boundaries | ||
|
||
## Context | ||
|
||
We wanted to implement error boundaries in our GO application to achieve the following: | ||
|
||
### Graceful Error Handling | ||
|
||
Error boundaries allows us to catch JavaScript errors anywhere in the component tree, log those errors, and display a fallback UI instead of crashing the entire application. This ensures a better user experience by preventing the app from breaking completely. | ||
|
||
### Component Isolation | ||
|
||
By wrapping specific components with error boundaries, we can isolate errors to those components. This means that an error in one part of the UI won't affect other parts, allowing the rest of the application to continue functioning normally. | ||
|
||
### Debugging and Logging | ||
|
||
Error boundaries can provide a way to log errors for debugging purposes. We can use them to send error reports to a logging service, which helps in monitoring and fixing issues more efficiently. | ||
|
||
### Fallback UI | ||
|
||
When an error is caught by an error boundary, we can display a fallback UI. This could be a simple error message, a "Something went wrong" page, or any custom UI that informs the user about the issue without exposing technical details. | ||
|
||
### Improved User Experience | ||
|
||
By handling errors gracefully and providing meaningful feedback to users, error boundaries contribute to a smoother and more reliable user experience. Users are less likely to encounter a completely broken application. | ||
|
||
## Decision | ||
|
||
We decided to implement an error boundary wrapper specifically for paragraphs, named `ParagraphErrorBoundary`. This ensures that if a paragraph encounters an error, the issue is contained within that specific section of the site, preventing it from affecting the rest of the application and ensuring the objectives described in the [context section](#context). | ||
|
||
The implementation of error boundaries will be an ongoing process. We will integrate them progressively, adding them to components where they provide the most benefit as we continue to develop and enhance the site. | ||
|
||
## Alternatives considered | ||
|
||
none | ||
|
||
## Consequences | ||
|
||
none |