Skip to content

Conversation

@alvarolivie
Copy link
Contributor

No description provided.

Copy link
Contributor

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 adds a new error helper function IsInvalid to the invopop client package, which checks if a response error corresponds to an HTTP 422 Unprocessable Entity status. This complements the existing error helper functions for other HTTP status codes like Conflict, NotFound, and Forbidden.

  • Adds IsInvalid() helper function for checking invalid request errors (HTTP 422)

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

Copy link
Contributor

@pmenendz pmenendz left a comment

Choose a reason for hiding this comment

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

Not sure about this.

The other errors make sense because they are tightly related to the error code. But I am not entirely sure about relating isInvalid to the UnprocessableEntity error.

@samlown
Copy link
Contributor

samlown commented Dec 11, 2025

The other errors make sense because they are tightly related to the error code. But I am not entirely sure about relating isInvalid to the UnprocessableEntity error.

Agreed. I'd just use the same name (IsUnprocessable) but most likely there is a better abstraction here related to validation, which is what this response normally implies.

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.

4 participants