-
Notifications
You must be signed in to change notification settings - Fork 53
Error processing 422 response codes #9
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
Comments
The 422 respose decoding is done here in Api, it is done according to documentation and it is covered by test. Could you point me to GitHub API documentation which endpoint do you call? Or send me the error response dump. |
I don't think its an issue with the Github API directly, but a use case where the $content->errors object is not returned in the response from Github. In this case, the re-production is to make a call to /orgs/:org/members?filter=2fa_disabled using an Access Token that is NOT part of the Owner team. That will produce the 422 response, which does not contain an "errors" element. Just a "message" with the text about not being authorized. I've submitted a Pull Request that has code to check to see if the $content->errors object exists before trying to use it to construct the message. Otherwise, it just uses the $content->message as the input to construct the exception. |
Here is the full trace of the response as well. Looking at the documentation, this seems to fall into the "custom" case, with the documenation_url link. Github Request:
) |
@zampettim Thank you! I misunderstood doc. |
When processing a request for Org members with 2fa using an account that is not part of the Owner team, the GH API returns a 422 response. The Api.php file tries to process the $content->errors property, but that doesn't exist in the response. So the response is missing the details of the error, and instead sees a stdClass::errors undefined property message.
The text was updated successfully, but these errors were encountered: