MCPcopy Create free account
hub / github.com/TruthHun/BookStack / wrapAsOperationalError

Function wrapAsOperationalError

static/word2md/mammoth.browser.js:6618–6636  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

6616
6617var rErrorKey = /^(?:name|message|stack|cause)$/;
6618function wrapAsOperationalError(obj) {
6619 var ret;
6620 if (isUntypedError(obj)) {
6621 ret = new OperationalError(obj);
6622 ret.name = obj.name;
6623 ret.message = obj.message;
6624 ret.stack = obj.stack;
6625 var keys = es5.keys(obj);
6626 for (var i = 0; i < keys.length; ++i) {
6627 var key = keys[i];
6628 if (!rErrorKey.test(key)) {
6629 ret[key] = obj[key];
6630 }
6631 }
6632 return ret;
6633 }
6634 util.markAsOriginatingFromRejection(obj);
6635 return obj;
6636}
6637
6638function nodebackForPromise(promise, multiArgs) {
6639 return function(err, value) {

Callers 1

nodebackForPromiseFunction · 0.70

Calls 1

isUntypedErrorFunction · 0.70

Tested by

no test coverage detected