<commit_before>var rescue = require('rescue')

// We do not set the code by calling `process.exit` immediately. We instead set
// set the exit code by hooking the exit event. This means that we're not going
// to shutdown hard, so if our dear user fails to cancel timers and close
// streams, shutdown is going to hang. That is what we want. A program know how
// to able to stop it's own event loops.

module.exports = function (process) {
    return function (error, exitCode) {
        if (error) {
            exitCode = rescue([
                /^bigeasy.arguable#abend$/m, function () {
                    if (error.stderr) {
                        process.stderr.write(error.stderr)
                        process.stderr.write('\n')
                    }
                    return error.exitCode
                },
                /^bigeasy.arguable#help$/m, function () {
                    process.stdout.write(error.stdout)
                    process.stdout.write('\n')
                    return error.exitCode
                }
// TODO Where is exit?
            ])(error)
            if (exitCode == null) {
                exitCode = 1
            }
        }
// TODO We ignore this now. It is always set thorugh `program`.
        if (exitCode != null) {
            process.exitCode = exitCode
        }
    }
}<commit_msg>Use exit code only if it is numeric.<commit_after>var rescue = require('rescue')

// We do not set the code by calling `process.exit` immediately. We instead set
// set the exit code by hooking the exit event. This means that we're not going
// to shutdown hard, so if our dear user fails to cancel timers and close
// streams, shutdown is going to hang. That is what we want. A program know how
// to able to stop it's own event loops.

module.exports = function (process) {
    return function (error, exitCode) {
        if (error) {
            exitCode = rescue([
                /^bigeasy.arguable#abend$/m, function () {
                    if (error.stderr) {
                        process.stderr.write(error.stderr)
                        process.stderr.write('\n')
                    }
                    return error.exitCode
                },
                /^bigeasy.arguable#help$/m, function () {
                    process.stdout.write(error.stdout)
                    process.stdout.write('\n')
                    return error.exitCode
                }
// TODO Where is exit?
            ])(error)
            if (exitCode == null) {
                exitCode = 1
            }
        }
// TODO We ignore this now. It is always set thorugh `program`.
        if (exitCode != null && typeof exitCode == 'number') {
            process.exitCode = exitCode
        }
    }
}
{'fraction_non_alphanumeric': 0.09730320699708454, 'fraction_numerical': 0.0007288629737609329, 'mean_word_length': 1.486413043478261, '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': '5717324', 'n_tokens_mistral': 728, 'n_tokens_neox': 683, 'n_words': 248}