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

Allow any type that implements FromServerFnError as a replacement of the ServerFnError in server_fn #3274

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

ryo33
Copy link

@ryo33 ryo33 commented Nov 22, 2024

Closes #3270
Fixes #3153
Addresses #3155

  • Added FromServerFnError
  • Deprecate the ServerFnError::WrappedServerError variant and manual error conversion helpers
  • Removed ServerFnErrorErr::WrappedServerError and impl From<ServerFnError> for ServerFnErrorErr
  • Update server_fn_macros to use the FromServerFnError trait
  • Added ServerFnErrorErr::Middleware for a better context of the errors
  • Added an example in examples/server_fn_axum
  • cargo +nightly make check

The implementation is complete. The only breaking changes should be the third ones mentioned above, and other behaviors should remain retained as expected.

@ryo33 ryo33 marked this pull request as ready for review November 22, 2024 04:08
@ryo33 ryo33 changed the title Add FromServerFnError trait to server_fn crate Allow any type that implements FromServerFnError as a replacement of the ServerFnError in server_fn Nov 22, 2024
@ryo33
Copy link
Author

ryo33 commented Nov 22, 2024

@nicolas-guichard Hi, this fix is similar to #3253, but takes a different approach, addressing #3153 and #3155. It would be great if you could take a look and review whether this approach works.

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