Skip to content

Conversation

@thinkingmedia
Copy link
Contributor

Closes #118

  • AbstractAdapter will no longer fail for unexpected body content.
  • NullException error is now thrown for all 500 response codes. (these response contain HTML body, but no JSON). So I figure NullException was more consistent than using TmdbApiException
  • Adds unit test for server 500 errors.

@wtfzdotnet
Copy link
Member

@thinkingmedia I clearly need to refactor some of the tests, ( with the new guzzle implementation included ), I'll try and get around it tomorrow or otherwise sometime next week.

@thinkingmedia
Copy link
Contributor Author

I've been running this patch on production for a few days, and it's working to catch when the API goes into maintenance. This happens for about an hour around 1:00am UTC and which API responses with 500 is just random. For example; all movie requests will fail but TV and People will still be working.

I don't have any handling for the other errors (except for 404). So I think if you are going to do any refactoring. It would be nice to use the original HTTP status codes instead of remapping them to constants in the API code. For most developers, the original HTTP status codes are more meaningful since the API end points are implemented using standard REST responses.

Does that make sense?

@wtfzdotnet wtfzdotnet changed the base branch from 2.0 to 2.1-beta October 15, 2016 23:28
@wtfzdotnet wtfzdotnet changed the base branch from 2.1-beta to 2.1 October 16, 2016 01:01
@wtfzdotnet wtfzdotnet merged commit 1c2dec1 into php-tmdb:2.1 Oct 16, 2016
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.

2 participants