Skip to content

The error-boundary example code causes infinite loop #5043

@w1n5t0n99

Description

@w1n5t0n99

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions