Skip to content

Commit f134d9f

Browse files
amirhhashemikodiakhq[bot]LadyBluenotes
authored
Mention ErrorBoundary for error handling (#1096)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Sarah <gerrardsarah@gmail.com>
1 parent 7698f9b commit f134d9f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/routes/guides/fetching-data.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ The `Switch/Match` construct provides one way to manage these conditions.
7474
When the fetch succeeds and user data is retrieved, the `user()` condition becomes active, and its related block executes.
7575
However, if there's an error while fetching, the `user.error` block becomes `true`, leading to its corresponding `Match` block being shown.
7676

77+
:::tip
78+
79+
If you anticipate errors, you may want to wrap `createResource` in an [ErrorBoundary](/reference/components/error-boundary).
80+
81+
:::
82+
7783
In addition to the `error` property, the `loading` property offers a way to display a loading state to the user during the fetch operation.
7884

7985

0 commit comments

Comments
 (0)