MCPcopy Index your code
hub / github.com/TruthHun/BookStack / fireRejectionEvent

Function fireRejectionEvent

static/word2md/mammoth.browser.js:5254–5276  ·  view source on GitHub ↗
(name, localHandler, reason, promise)

Source from the content-addressed store, hash-verified

5252}
5253
5254function fireRejectionEvent(name, localHandler, reason, promise) {
5255 var localEventFired = false;
5256 try {
5257 if (typeof localHandler === "function") {
5258 localEventFired = true;
5259 if (name === "rejectionHandled") {
5260 localHandler(promise);
5261 } else {
5262 localHandler(reason, promise);
5263 }
5264 }
5265 } catch (e) {
5266 async.throwLater(e);
5267 }
5268
5269 if (name === "unhandledRejection") {
5270 if (!activeFireEvent(name, reason, promise) && !localEventFired) {
5271 formatAndLogError(reason, "Unhandled rejection ");
5272 }
5273 } else {
5274 activeFireEvent(name, promise);
5275 }
5276}
5277
5278function formatNonError(obj) {
5279 var str;

Callers 1

mammoth.browser.jsFile · 0.70

Calls 2

activeFireEventFunction · 0.70
formatAndLogErrorFunction · 0.70

Tested by

no test coverage detected