Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render error handling #85

Closed
Tracked by #50
mofojed opened this issue Oct 6, 2023 · 2 comments · Fixed by #436
Closed
Tracked by #50

Render error handling #85

mofojed opened this issue Oct 6, 2023 · 2 comments · Fixed by #436

Comments

@mofojed
Copy link
Member

mofojed commented Oct 6, 2023

When there's an error rendering an element, the error is just printed to the python console out of band and is kind of disruptive. The error should be communicated to the client so that it can display an appropriate toast or error message in the console with more help.

A sample bit of code for a component that throws:

from deephaven import ui

@ui.component
def bad_comp():
    raise Exception("This component throws")

bc = bad_comp()
@bmingles
Copy link
Contributor

bmingles commented Mar 5, 2024

As part of this, we should add an ErrorBoundary at the panel level to keep errors isolated to single panels

@alexpeters1208
Copy link
Contributor

Here's another example of code that throws without any feedback:

from deephaven import ui

@ui.component
def button_group_panel(set_val):
    return ui.panel(
        ui.button_group(
            ui.button("Val1", on_press=set_val),
            ui.button("Val2", on_press=set_val)
        )
    )

@ui.component
def display_panel(val):
    return ui.panel(
        ui.text(val)
    )

@ui.component
def my_layout():
    val, set_val = ui.use_state("Val1")

    return ui.row(
        ui.column(
            button_group_panel(set_val)
        ),
        ui.column(
            display_panel(val)
        )
    )

my_dashboard = ui.dashboard(my_layout())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants