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

add docs for exception handler #818

Merged
merged 3 commits into from
Jul 28, 2024
Merged

add docs for exception handler #818

merged 3 commits into from
Jul 28, 2024

Conversation

Lendemor
Copy link
Collaborator

No description provided.

Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some minor nits.

I'm wondering though (outside of this PR) should exception handlers be tied to event handlers? then for example you could update your state if something happened.

docs/utility_methods/exception_handlers.md Outdated Show resolved Hide resolved
docs/utility_methods/exception_handlers.md Outdated Show resolved Hide resolved
docs/utility_methods/exception_handlers.md Outdated Show resolved Hide resolved
```python
import reflex as rx

def custom_frontend_handler(exception: Exception) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add some examples of actual handlers here to show how it could work

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you have in mind for actual handlers? Printing the exception ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think printing it makes sense, just to show a practical way someone may use it

# My custom logic for backend errors
pass

app = rx.App()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try this with the kwargs approach instead

@picklelo picklelo merged commit 00f294d into main Jul 28, 2024
4 checks passed
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 this pull request may close these issues.

2 participants