How to use the verror.VError.fullStack 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 serafin-labs / serafin / src / serafin / api / transport / rest / Rest.ts View on Github external
public handleError(error, res: express.Response, next: (err?: any) => void) {
        // handle known errors
        if (![[ValidationErrorName, 400], [NotFoundErrorName, 404], [ConflictErrorName, 409], [NotImplementedErrorName, 405], [UnauthorizedErrorName, 401]].some((p: [string, number]) => {
            let [errorName, code] = p;
            if (VError.findCauseByName(error, errorName)) {
                res.status(code).json({
                    code: code,
                    message: error.message
                })
                return true
            }
            return false
        })) {
            // or pass the error down the chain
            console.error(VError.fullStack(error));
            next(error)
        }
    }
github ravendb / ravendb-nodejs-client / test / Utils / TestUtil.ts View on Github external
afterEach(function () {
        if (this.currentTest && this.currentTest.state === "failed") {
            console.error(VError.fullStack(this.currentTest.err));
        }
    });
github faastjs / faast.js / src / error.ts View on Github external
get fullStack(): string {
        return VError.fullStack(this);
    }
github ravendb / ravendb-nodejs-client / src / Exceptions / index.ts View on Github external
export function printError(err: Error): string {
    return VError.fullStack(err);
}