47degrees/github4s

Most GH error bodies are returned as JsonProcessingException.

kalexmills opened this issue · 4 comments

Right now we're not making any attempt to read the JSON response bodies returned by GitHub on an error. This means legitimate errors returned by GitHub are coming through as JsonProcessingExceptions.

Seems like an extra domain model or two along with some different logic in the run method in HttpClient would suffice to making a cleaner unhappy path.

Related to #363

I was planning on doing exactly that, the whole error hierarchy needs redoing too.

I was thinking we'd need at least a couple:

  • Unauthorized
  • RateLimitExceeded

At that link, it looks like GH also has standard domain errors we could lift into exceptions by checking under the "code" field, things like

  • MissingResource
  • MissingField
  • InvalidFormatting
  • ResourceAlreadyExists

created #440

done in #440