Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} catch (e) {
err = e
}
}
if (err && !quietErr && node.errorFn) {
try {
node.errorFn(err, args)
} catch (recursiveErr) {
// swallow any errors during error handling,
// and just propagate the original error
console.warn(recursiveErr, data.getDebugContext(node))
}
}
if (result && Q.isPromiseLike(result)) {
Q.resolve(result)
.thenBound(onSuccess, null, data)
.failBound(onError, null, data)
.thenBound(onComplete, null, data)
return
}
// onSuccess throws if there's a Shepherd type error
try {
if (!err) onSuccess(data, result)
} catch (e) {
err = e
}
if (err) onError(data, err)
onComplete(data, result)