facebook-nodejs-business-sdk
facebook-nodejs-business-sdk copied to clipboard
Facebook’s CrashReporter logs a line on every uncaught exception in the Node project, not just Facebook’s
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
- In any Node project, throw an error and ensure it is uncaught
- 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
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.