#return errors that implement IntoResponse from server functions

1 messages · Page 1 of 1 (latest)

grim crow
#

Hello,

I have an error type that I implement IntoResponse on, and on axum handlers I can just return the error, and it would set the correct status code and send the error message
and I would like to use that with dioxus' server functions, since I want to handle the error and redirect the user to another page on the server

is that possible?

lofty chasm
#

If your error implements serialize + deserialize, you can impl AsStatusCode to use it

#

Challenge is the client also needs to be able to recreate the same error from the payload