How to use the verror.errorForEach function in verror

To help you get started, we’ve selected a few verror examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joyent / manatee / lib / adm.js View on Github external
if (!currentDepth) {
        currentDepth = 0;
    }

    if (currentDepth >= maxDepth) {
        return;
    }

    indent = '';
    for (var i = 0; i < currentDepth; i++) {
        indent += '  ';
    }

    currentDepth++;
    VError.errorForEach(error, function (e) {
        console.error(indent, '-', e.message);
        if (e.cause()) {
            printVErrorIter(e.cause(), maxDepth, currentDepth);
        }
    });
}