ejholmes/restforce — pull request #75 by daveespo (2013-06-18 21:06:47+00:00)
Title: Gracefully handle 413/Too Large when doing a SOQL query

This is a half-patch. If you supply a SOQL query longer than 8192 in length (at least, that's what the Databasedotcom gem claims the max REST SOQL query length is), the GET request either terminates abnormally (Connection reset, etc.) or returns a 413 with an empty body

This patch handles the 413 gracefully. Otherwise, it blows up with a JSON parsing error due to the empty body.

I'm hesitant to provide a patch to enforce a 8192 query length limit since it's not documented in any official Salesforce REST API docs (that I could find, at least)