facebook / facebook-nodejs-business-sdk

Node.js SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
490 stars 226 forks source link

Facebook’s CrashReporter logs a line on every uncaught exception in the Node project, not just Facebook’s #231

Open BrandLibel opened 2 years ago

BrandLibel commented 2 years ago

Which SDK version are you using?

v12.0.1 but the problematic code is also on the latest version, v14.0.0

What's the issue?

Facebook’s crash reporter exists to send errors in Facebook’s SDK to Facebook.

But it also does something potentially misleading: it prints a console.log for every single uncaught exception in the node project using the Facebook SDK. When my application got errors from my own business logic, the fact that Facebook’s SDK logged a "CrashReporter" message threw me off and made me think the issue was related to Facebook.

The problem is this event listener: https://github.com/facebook/facebook-nodejs-business-sdk/blob/5ad4e52e222fc90367d215a579339a88982c734d/src/crash-reporter.js#L26-L27

This will listen for every error in the entire node process.

Steps/Sample code to reproduce the issue

  1. In any Node project, throw an error and ensure it is uncaught
  2. Trigger the error created in step 1

Observed Results:

In the application logs, the message CrashReporter: No SDK crash detected or crash reporter is disabled! from the Facebook SDK is printed.

Expected Results:

No message at all is printed since the exception has nothing to do with Facebook’s SDK

angel3cu commented 1 year ago

We are facing the same issue in our work project. The unhandled exception is caught at this exact line of code. It was very misleading initially, delaying our investigations of the actual issue we were facing, until we figured out what it was. Ideally, Facebook SDK should not be catching unhandled exceptions for the whole project.

KaSakee commented 5 months ago

Similarly, it is quite frustrating and makes no sense, what does the Facebook SDK do with anything if the issue occurs outside of it?

grozwalker commented 4 months ago

Same issue:( But only in node v20, in v18 no problems