kevinohara80 / nforce

nforce is a node.js salesforce REST API wrapper for force.com, database.com, and salesforce.com
MIT License
474 stars 167 forks source link

Guard against non-json error responses #35

Closed chrishic closed 10 years ago

chrishic commented 10 years ago

Starting with v28.0 of the SF REST API call, getIdentity(), if an access token has expired, SF does not return an actual JSON error response as expected (i.e. an array of error hashes). Instead, it returns a one-line error string in the body along with HTTP code 403. This change handles this scenario, such that when bubbled up to the caller, the caller knows to refresh the token.

kevinohara80 commented 10 years ago

Thanks, landed in Master.