Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function findCause(err) {
var next;
while((next = verror.cause(err))!=null) {
if(next instanceof verror.VError) {
err = next;
}
else {
break;
}
}
return err;
}
function findDeepestInfoProperty(err, property) {
if(err instanceof verror.VError) {
var result = findDeepestInfoProperty(verror.cause(err), property);
return result || verror.info(err)[property];
}
return null;
}