UNPKG

e2ed

Version:

E2E testing framework over Playwright

17 lines (16 loc) 638 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getGlobalErrorHandler = void 0; const error_1 = require("./error"); const fs_1 = require("./fs"); const generalLog_1 = require("./generalLog"); /** * Get handler for `uncaughtException` and `unhandledRejection` errors. * @internal */ const getGlobalErrorHandler = (type) => (cause) => { const error = new error_1.E2edError(`Caught ${type}`, { cause }); void (0, fs_1.writeGlobalError)(error.toString()).catch(() => { }); void (0, generalLog_1.writeLogsToFile)().catch(() => { }); }; exports.getGlobalErrorHandler = getGlobalErrorHandler;