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

fix: correct 404 not found responses and few test changes #137

Closed

Conversation

thisdudkin
Copy link
Contributor

Improved handling of 404 errors for non-existing owners and pets in the POST /owners/{ownerId}/pets endpoint. Also switched to using records for error information to simplify and modernize the code.

This PR addresses #130 and enhances both the error handling and the structure of the error responses.

Changes:

  • Fixed the endpoint to return a 404 Not Found status for non-existing owners or pets instead of a 400 Bad Request.
  • Refactored error handling by replacing the previous class-based error representation with Java record, which stands for a more concise and immutable way to handle error details.
  • Few test changes, because the old version was wrong

Please review and merge this update.

@thisdudkin thisdudkin closed this Aug 10, 2024
@thisdudkin thisdudkin deleted the fix/404-error-handling branch August 10, 2024 23:13
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