Thuzi / facebook-node-sdk

Modeled from the (Facebook Javascript SDK), now with the facebook-node-sdk you can now easily write the same code and share between your server (nodejs) and the client (Facebook Javascript SDK).
Other
736 stars 250 forks source link

Error Code on Login Not Correctly Represented in JSON Structure. #96

Open rickwaugh1 opened 9 years ago

rickwaugh1 commented 9 years ago

When I log in to Facebook, and I get an error back, such as with an invalid id or token, I get the following structure back:

{ error_code : 2, token: 'abcdefghiii', token_secret: undefined, source_service: 'Facebook', source_service_id: '123456789', error_message: 'Invalid OAuth access token.', error: true }

Note error_code. If I have named my structure, fb_response, I cannot get at this with fb_response["error_code"]. I have to use fb_response["error_code "], because an extra space comes back between the member name and colon.

dantman commented 8 years ago

Does this error happen anymore?

Errors from Facebook appear to use an {error:{message: "...", code: ###}} object now.

rickwaugh1 commented 8 years ago

Haven't looked in a long time.