Skip to content

rusk: map dispatch parse errors to 404/422#4032

Open
Neotamandua wants to merge 1 commit intomasterfrom
neotamandua/dispatch_404_422
Open

rusk: map dispatch parse errors to 404/422#4032
Neotamandua wants to merge 1 commit intomasterfrom
neotamandua/dispatch_404_422

Conversation

@Neotamandua
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a dedicated request parsing error type for RUES dispatch and maps specific parsing failures to more appropriate HTTP status codes (404/422), with added test coverage.

Changes:

  • Added RequestParseError and updated RuesDispatchEvent::from_request to return it.
  • Updated request handling to translate parse errors into 404 (invalid path) / 422 (invalid payload) responses.
  • Added tests asserting the new status code behavior and generalized a status/body assertion helper.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
rusk/src/lib/http/event.rs Introduces RequestParseError and replaces panicking/opaque parsing failures with typed parse errors.
rusk/src/lib/http.rs Maps RequestParseError to 404/422/500 responses and adds tests for invalid path and invalid UTF-8 payload handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant