<commit_before>var http = require("http");
var Promise = require("bluebird");
function ping(url, port) {
    var promise = new Promise(function (resolve) {
        var result;
        var options = { host: url, port: port || 80, path: '/' };
        var start = Date.now();
        var pingRequest = http.request(options, function () {
            result = Date.now() - start;
            resolve(result);
            pingRequest.abort();
        });
        pingRequest.on("error", function () {
            result = -1;
            resolve(result);<commit_msg>Reject on error instead of resolving.<commit_after>var http = require("http");
var Promise = require("bluebird");
function ping(url, port) {
    var promise = new Promise(function (resolve, reject) {
        var result;
        var options = { host: url, port: port || 80, path: '/' };
        var start = Date.now();
        var pingRequest = http.request(options, function () {
            result = Date.now() - start;
            resolve(result);
            pingRequest.abort();
        });
        pingRequest.on("error", function () {
            result = -1;
            reject(result);
{'fraction_non_alphanumeric': 0.141991341991342, 'fraction_numerical': 0.005194805194805195, 'mean_word_length': 2.141304347826087, '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': '3042629', 'n_tokens_mistral': 318, 'n_tokens_neox': 306, 'n_words': 87}