DioxusLabs / DioxusLabs/dioxus

The error-boundary example code causes infinite loop

Open
#5,043 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

https://dioxuslabs.com/learn/0.7/essentials/basics/error_handling/#downcasting-specific-errors
The example code to downcast an error and rethrow if necessary causes an infinite loop

```
rsx! {
ErrorBoundary {
handle_error: |error: ErrorContext| {
// Network errors need to be handled by a different error boundary!
if let Some(err) = error.error() {
return Err(e.into())
}

// Otherwise, handle this error here
rsx! {
div { "Oops, we encountered an error" }
}
},
// ...
}
}
```

- Dioxus version: 0.7.1
- Rust version: 1.91.1
- OS info: WSL2
- App platform: web

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.