_onTerminated(message, error) { this._printTestResults(); console.log(`${RED_COLOR}## TERMINATED ##${RESET_COLOR}`); console.log('Message:'); console.log(` ${RED_COLOR}${message}${RESET_COLOR}`); if (error && error.stack) { console.log('Stack:'); console.log(error.stack.split('\n').map(line => ' ' + line).join('\n')); } process.exit(2); }
main().catch((error) => { console.error('Fatal error'); console.error(error); process.exit(1); });
cluster.on("disconnect", function(worker) { if (production) { if (!stopping) { cluster.fork(); } } else process.exit(1); });
function afterPageCreation(filename) { process.stdout.write('\n'); process.stdout.write(`New Component ${filename} is created and ready!`); process.stdout.write('\n'); process.stdout.write('\n'); process.exit(0); }
async function init(frontend, env, cols, rows) { try { const pty = require('node-pty'); return rpc.handle(new Terminal(frontend, pty, env, cols, rows)); } catch (e) { await frontend.initFailed(e.stack); setImmediate(() => process.exit(0)); return null; } }
// Check connections dns.lookup('fast.com', error => { if (error && error.code === 'ENOTFOUND') { console.error( chalk.red( `${lineBreak(1)}${spacing(1)}Please check your internet connection.${lineBreak(1)}` ) ); process.exit(1); } });
onRunComplete(contexts, results) { // console.log('Custom reporter output:'); // console.log('GlobalConfig: ', this._globalConfig); // console.log('Options: ', this._options); // console.log("Results: ", results); if (results && results.numFailedTests === 0) { process.exit(); } else { process.exit(1); } }
main().catch((error) => { console.error(error); process.exit(1); }).then(() => { return fs.remove(tempDir); });
process.on('SIGINT', () => { watcher.close(); flowServer.kill(); console.log(CLEARLINE + yellow(invert('stopped watching'))); process.exit(); });
function exitError (err) { cli.showUsage() if (err && err.message) { console.log('\x1b[31m') console.trace(err) if (err.message === 'Unable to determine the domain name') { console.log('-> check your connection options to the docker daemon and confirm containers exist') } console.log('\x1b[0m') } process.exit(-1) }
nodeVersionData((err, versions) => { if (err) { console.error('Aborting due to download error from node or iojs') console.error(err.stack) return process.exit(1) } fs.writeFileSync( path.join(__dirname, '..', 'source', 'versions.json') , JSON.stringify(versions, null, 2) ) })
/** * @description Shutdown Gladys instance. * @example * shutdown(); */ async function shutdown() { // gracefully shutdown db await this.sequelize.close(); // exit process.exit(); }
benchmarks.run().catch(err => { console.error(err.stack); // eslint-disable-next-line no-process-exit process.exit(1); });
/** * @description Shutdown Gladys instance. * @example * shutdown(); */ async function shutdown() { // gracefully shutdown db await this.sequelize.close(); // exit process.exit(); }
main().catch((error) => { console.error('Fatal error'); console.error(error); process.exit(1); });