Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i get Facebook error codes from a "FacebookAds::ClientError" #64

Closed
iamricks opened this issue Feb 27, 2019 · 1 comment
Closed

Comments

@iamricks
Copy link

What's the issue?

When handling errors with Facebook, best practice is to use the error codes since the descriptions can change.

Facebook lays out the error codes here to make it easier to handle:
https://developers.facebook.com/docs/marketing-api/error-reference/

Observed Results:

It looks like the only things being returned are fb_message, error_user_title and fbtrace_id
according to this:
https://github.com/facebook/facebook-ruby-business-sdk/blob/55700ad0afee5fa4a8f521ad4615fcff54d2d6a9/lib/facebook_ads/errors.rb

Expected Results:

It should return an error code for the message being returned

Question:

Is there any way to get this error code that belongs to the message?

@iamricks
Copy link
Author

I didn't review the code thoroughly enough.

Looks like you can just do e.code on the error and receive the code for the exception that is raised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant