<commit_before>'use strict';


function RequestError(cause) {

    this.name = 'RequestError';
    this.message = String(cause);
    this.cause = cause;

    Error.captureStackTrace(this);

}
RequestError.prototype = Object.create(Error.prototype);
RequestError.prototype.constructor = RequestError;


function StatusCodeError(statusCode, message) {

    this.name = 'StatusCodeError';
    this.statusCode = statusCode;
    this.message = statusCode + ' - ' + message;

    Error.captureStackTrace(this);

}
StatusCodeError.prototype = Object.create(Error.prototype);
StatusCodeError.prototype.constructor = StatusCodeError;


module.exports = {
    RequestError: RequestError,
    StatusCodeError: StatusCodeError
};
<commit_msg>Improved Error types to work in browsers without v8 engine<commit_after>'use strict';


function RequestError(cause) {

    this.name = 'RequestError';
    this.message = String(cause);
    this.cause = cause;

    if(Error.captureStackTrace){
      Error.captureStackTrace(this);
    } else {
      Error.call(this);
    }

}
RequestError.prototype = Object.create(Error.prototype);
RequestError.prototype.constructor = RequestError;


function StatusCodeError(statusCode, message) {

    this.name = 'StatusCodeError';
    this.statusCode = statusCode;
    this.message = statusCode + ' - ' + message;

    if(Error.captureStackTrace){
      Error.captureStackTrace(this);
    } else {
      Error.call(this);
    }

}
StatusCodeError.prototype = Object.create(Error.prototype);
StatusCodeError.prototype.constructor = StatusCodeError;


module.exports = {
    RequestError: RequestError,
    StatusCodeError: StatusCodeError
};

{'fraction_non_alphanumeric': 0.11198073449729079, 'fraction_numerical': 0.0006020469596628537, 'mean_word_length': 4.12962962962963, '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': '1400804', 'n_tokens_mistral': 480, 'n_tokens_neox': 463, 'n_words': 85}