pub type RenderFnResultWithCause<T> = Result<T, GenericErrorWithCause>;
Expand description

A generic error type that can be adapted for any errors the user may want to return from a render function, as with RenderFnResult<T>. However, this also includes a mandatory statement of causation for any errors, which assigns blame for them to either the client or the server. In cases where this is ambiguous, this allows returning accurate HTTP status codes.

Note that you can automatically convert from your error type into this with .into() or ?, which will blame the server for the error by default and return a 500 Internal Server Error HTTP status code. Otherwise, you’ll need to manually instantiate ErrorWithCause and return that as the error type.