fayland/perl-net-github — pull request #55 by neilbowers (2014-12-12 10:07:49+00:00)
Title: Include additional error information from the API when croaking

Hi!

I was trying a code search, but just getting an error message "Validation Failed",
which wasn't very helpful. I tried the search in the browser, and got this response:

{
"message": "Validation Failed",
"errors": [
{
"message": "Must include at least one user, organization, or repository",
"resource": "Search",
"field": "q",
"code": "invalid"
}
],
"documentation_url": "https://developer.github.com/v3/search/#search-code"
}

Ahh, that inner message explained my problem.

This change takes any additional 'message' strings found in the 'errors' array,
and appends them on the error message. So now my (broken) script croaks with:

Validation Failed: Must include at least one user, organization, or repository

Much better! :-)