Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify KiwiStandardResponses#standardErrorResponse to verify the response status is a client or server error #1165

Closed
sleberknight opened this issue Jul 22, 2024 · 2 comments
Assignees
Labels
enhancement A request for change or improvement to an existing feature
Milestone

Comments

@sleberknight
Copy link
Member

KiwiStandardResponses#standardErrorResponse allows any Response.Status to be supplied.

It should validate that the status is either a client (4xx) or server (5xx) error.

Also, remove the javadoc which says "Does not verify that the given status is actually an error status". It can be replaced with an @throws javadoc that says it throws IllegalArgumentException if the given status is not a client or server error.

@sleberknight sleberknight added the enhancement A request for change or improvement to an existing feature label Jul 22, 2024
@sleberknight sleberknight added this to the 4.3.0 milestone Jul 22, 2024
@sleberknight sleberknight self-assigned this Aug 9, 2024
@sleberknight
Copy link
Member Author

Instead of removing the javadoc, change it to state that the method does verify that the response status is actually an error status code (4xx or 5xx).

@sleberknight
Copy link
Member Author

Also, while there is a small probability that there is some code that calls standardErrorResponse with a status that is not a client or server error code. But this really doesn't make sense, i.e., to call it with a 200 status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A request for change or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant