layout | id | title |
---|---|---|
api |
promise.onpossiblyunhandledrejection |
Promise.onPossiblyUnhandledRejection |
##Promise.onPossiblyUnhandledRejection
<script type="text/javascript">
var disqus_title = "Promise.onPossiblyUnhandledRejection";
var disqus_shortname = "bluebirdjs";
var disqus_identifier = "disqus-id-promise.onpossiblyunhandledrejection";
Promise.onPossiblyUnhandledRejection(function(any error, Promise promise) handler) -> undefined
Note: this hook is specific to the bluebird instance it's called on, application developers should use global rejection events
Add handler
as the handler to call when there is a possibly unhandled rejection. The default handler logs the error stack to stderr or console.error
in browsers.
Promise.onPossiblyUnhandledRejection(function(e, promise) {
throw e;
});
Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections.
(function() {
var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true;
dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
(document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq);
})();