Implement Into<CaptureError> for the default server function error type
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 https://github.com/DioxusLabs/dioxus/issues/3243. We now use json serialization for the default error type or you can use a custom error type for more control
Will this affect https://github.com/DioxusLabs/dioxus/issues/3832?
Will this affect #3832?
No, this is still a server-only datatype. That issue should already be fixed in 0.7 with the new server fn release. You can now return any error that implements FromServerFnError