All Collections
Advanced usage
What does "Potentially unhandled promise" mean?
What does "Potentially unhandled promise" mean?
Jordi Giménez avatar
Written by Jordi Giménez
Updated over a week ago

If you enable the automatic crash reporting on Javascript-based applications, the Bugfender SDK will try to catch all errors thrown by your application.

The Bugfender SDK can automatically log two types of errors:

  • User-defined exceptions, when your code or the code you're calling uses throw to throw an exception.

  • Unhandled promise rejections, when your code returns a Promise and reject() is called on it, but your application didn't define a callback for that case.

You will get a "crash" in Bugfender with the text "Potentially unhandled promise" when Bugfender detects an unhandled promise rejection.

Please note the Promise is potentially unhandled because the Bugfender SDK listens for unhandled rejections, but your application could be doing that too. When an unhandled rejection is thrown, the Bugfender SDK watches the rejection for one millisecond to see if your application handles it, and if it doesn't, it will emit the "Potentially unhandled promise" message. It is therefore possible (although unlikely) to see the "Potentially unhandled promise" error message for promise rejections that were handled after one millisecond.

Also note Promise rejections do not contain the context where the rejection occured, so it is not possible to print a stacktrace. There are proposals for that, and we are watching them as they evolve.

Did this answer your question?