Skip to content

Implement Into<CaptureError> for the default server function error type #4205

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

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

Conversation

ealmloff
Copy link
Member

@ealmloff ealmloff commented May 26, 2025

Now that the server function crate has support for custom error types, we can use a type that is easier to convert into the dioxus error type. This PR switches to our own implementation of a server error type which can be converted into the dioxus captured error type with ?.

Why can't we use the CapturedError type directly?

The CapturedError type is a boxed Error without the Send requirement. We need the error type to implement Send for our axum integration. Serializing the CapturedError type also has some odd interactions. If you serialize the type and then try to downcast it, the downcast will fail because the serialization and deserialization looses the type information

This and the new server function custom error type support close #3243. We now use json serialization for the default error type or you can use a custom error type for more control

@ealmloff ealmloff added enhancement New feature or request breaking This is a breaking change fullstack related to the fullstack crate labels May 26, 2025
@ealmloff ealmloff marked this pull request as ready for review May 26, 2025 19:20
@ealmloff ealmloff requested a review from a team as a code owner May 26, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This is a breaking change enhancement New feature or request fullstack related to the fullstack crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance the ergonomics and security of ServerFnError
1 participant