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

Add error_user_title and error_user_msg fields in APIError #423

Closed
wants to merge 1 commit into from

Conversation

isra17
Copy link
Contributor

@isra17 isra17 commented Dec 15, 2014

In some case, Facebook API includes error_user_title and error_user_msg with more descriptive message that can be used to know which parameter is invalid and why.
Example:

{
  "error": {
    "message": "Invalid parameter",
    "type": "FacebookApiException",
    "code": 100,
    "error_subcode": 1349118,
    "is_transient": false,
    "error_user_title": "Disallowed Post Link",
    "error_user_msg": "One or more of the given URLs is not allowed by the Stream post URL security app setting. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains. Read https://developers.facebook.com/docs/facebook-login/security/ to learn more about app settings related to security."
  }
}

Including this message is way more usefull than just having the error.message value.

@isra17
Copy link
Contributor Author

isra17 commented Dec 15, 2014

Just saw this PR after I created mine: #412 ...
Pretty much the same except mine include the new fields in the error message.

@nickhoffman
Copy link

This looks great. 👍

@arsduo
Copy link
Owner

arsduo commented Dec 27, 2014

Thanks! I'd merged in #412 already, so I manually added the code for the error message as you suggested.

@arsduo arsduo closed this Dec 27, 2014
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

Successfully merging this pull request may close these issues.

None yet

3 participants