Skip to content

Conversation

@jkelleyrtp
Copy link
Member

This fixes an issue where the new server functions wouldn't set the status code of the response when using ServerFnError or custom error types.

There doesn't seem to be a simple mechanism in Rust to let us automatically downcast the From<ServerFnError> + Serialize + Deserialize type we were using for custom error types, so now, to use a custom error type, it must implement AsStatusCode which has a single method as_status_code where you can customize what status code each variant turns into.

@jkelleyrtp jkelleyrtp marked this pull request as ready for review October 13, 2025 21:19
@jkelleyrtp jkelleyrtp requested a review from a team as a code owner October 13, 2025 21:19
@jkelleyrtp jkelleyrtp merged commit 8f6e7dc into main Oct 13, 2025
18 of 19 checks passed
@jkelleyrtp jkelleyrtp deleted the jk/custom-error-status-codes branch October 13, 2025 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants