mikemaccana/dnsimple-python — pull request #4 by jmurty (2012-08-30 01:31:53+00:00)
Title: Return service-provided JSON data whenever possible on HTTP error response

This change is small but potentially contentious.

Rather than treating non-success HTTP responses as errors and raising an exception, with this change *any* non-success response with JSON-parseable body content will return the JSON data instead. This means more work for callers to detect and handle non-success responses, but also more flexibility for handling them.

This was motivated to make it easier to handle "semantic" errors like the 422 you get if you try to re-create a pre-existing domain record. DNSimple replies with a 422 and JSON data including a useful warning message, which data was previously lost.