civicrm/civicrm-core — pull request #1596 by xurizaemon (2013-09-04 22:29:29+00:00)
Title: Handle JSON decode errors in API requests, throw synthetic error.

Moves the json_decode() error handling below where it is in xavier's version, so it applies for both cURL and file_get_contents().