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

Error message is undefined #42

Closed
thierryjacoel opened this issue Apr 24, 2018 · 10 comments · May be fixed by #158
Closed

Error message is undefined #42

thierryjacoel opened this issue Apr 24, 2018 · 10 comments · May be fixed by #158
Labels

Comments

@thierryjacoel
Copy link

I have tried to create a new AdAccount for my business, and I can see in the network panel of the browser devtools that I get an error with a message One or more of the ad accounts in your business manager are currently in bad standing or in review. All of your accounts must be in good standing in order to create or add new ad accounts.

However, when I try to display the error message to the user, the message is undefined.

I can see when I console log the FacebookRequestError that the message field is indeed undefined. When looking at the source, it seems that the generation of the Error object expects a name property on the object returned by Facebook, but it is not present (maybe a legacy thing).

Adding a general case in https://github.com/facebook/facebook-nodejs-ads-sdk/blob/master/src/exceptions.js#L68 would at least allow a non-conventional value for the name to not ignore the message returned.

@codytwinton
Copy link
Contributor

It seems like this issue has been open for more than a few months now. We have made many changes in the SDK since then, including releasing a new version. If you can repro your specific issue with the latest version of the SDK, please create a new issue or comment here with further details.

@NovoManu
Copy link

Hi,
Error is still happens.
1
2

@codytwinton codytwinton reopened this Aug 20, 2018
@codytwinton
Copy link
Contributor

Ok, thanks for the heads up!

NovoManu pushed a commit to NovoManu/facebook-nodejs-business-sdk that referenced this issue Sep 15, 2018
NovoManu pushed a commit to NovoManu/facebook-nodejs-business-sdk that referenced this issue Mar 17, 2019
@stale
Copy link

stale bot commented Jan 14, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Jan 14, 2020
@NovoManu
Copy link

Didn't fixed yet

@stale stale bot removed the Stale label Jan 14, 2020
@bduffany
Copy link

bduffany commented Mar 24, 2020

Did some digging. The FacebookRequestError class here is expecting an object that looks like an error returned by the requestPromise API. But in the browser, XMLHttpRequest is used, not requestPromise. The structure of the error object is completely different (see the code here).

A possible fix could be to modify the Error returned by xmlHttpRequest to look "close enough" to the error returned by requestPromise.

@bduffany
Copy link

bduffany commented May 8, 2020

Any update on this? It makes the API very difficult to use on the client side, since we can't properly log errors.

EDIT: NVM, I just went ahead and fixed it. See #158

@stale
Copy link

stale bot commented Aug 8, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Aug 8, 2020
@stale
Copy link

stale bot commented Aug 16, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Aug 16, 2020
@bduffany
Copy link

Hi, the issue is still present and my PR is still open. #158

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