<commit_before>#!/usr/bin/env node
'use strict';

var process = require('process');

var Application = require('./app.js');

module.exports = main;

/*istanbul ignore else*/
if (require.main === module) {
    main();
}

function main() {
    var app = Application();

    // attach before throwing exception
    process.on('uncaughtException', app.clients.uncaught);

    app.bootstrap(function onAppReady(err) {
        /*istanbul ignore if*/
        if (err) {
            throw err;
        }

        // TODO set process.title

        app.clients.logger.info('server started', {
            serverAddress: app.clients.rootChannel.address()
        });
    });
}<commit_msg>server exit 1 if we cannot start<commit_after>#!/usr/bin/env node
'use strict';

var process = require('process');

var Application = require('./app.js');

module.exports = main;

/*istanbul ignore else*/
if (require.main === module) {
    main();
}

function main() {
    /*eslint no-process-exit: 0*/
    var app = Application();

    // attach before throwing exception
    process.on('uncaughtException', app.clients.uncaught);

    app.bootstrap(function onAppReady(err) {
        /*istanbul ignore if*/
        if (err) {
            app.clients.logger.fatal('Could not start', {
                error: err
            });
            return process.exit(1);
        }

        // TODO set process.title

        app.clients.logger.info('server started', {
            serverAddress: app.clients.rootChannel.address()
        });
    });
}
{'fraction_non_alphanumeric': 0.14576493762311227, 'fraction_numerical': 0.001969796454366382, 'mean_word_length': 2.334792122538293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4302787', 'n_tokens_mistral': 450, 'n_tokens_neox': 434, 'n_words': 107}