<commit_before>var pathToRegexp = require('path-to-regexp');
var ok = require('assert').ok;
var inspect = require('util').inspect;
var methodPathRegExp = /^([^\s]+)\s+(.+)$/;
var routesList =[];
var loader = require('./routes-loader');

function createHandler(middleware) {
    var len = middleware.length;

    return function (req, res, finalNext) {
        var i=-1;

        function next() {
            i++;

            if (i === len) {
                finalNext();
            } else {
                middleware[i](req, res, next);
            }
        }

        next();
    };
}

function Route(routeConfig) {
    var path = routeConfig.path;
    if (!path) {
        throw new Error('"path" is required for route. Route config: ' + inspect(routeConfig));
    }
<commit_msg>should pass error down the line<commit_after>var pathToRegexp = require('path-to-regexp');
var ok = require('assert').ok;
var inspect = require('util').inspect;
var methodPathRegExp = /^([^\s]+)\s+(.+)$/;
var routesList =[];
var loader = require('./routes-loader');

function createHandler(middleware) {
    var len = middleware.length;

    return function (req, res, finalNext) {
        var i=-1;

        function next(err) {
            i++;

            if (i === len) {
                finalNext(err);
            } else {
                middleware[i](req, res, next);
            }
        }

        next();
    };
}

function Route(routeConfig) {
    var path = routeConfig.path;
    if (!path) {
        throw new Error('"path" is required for route. Route config: ' + inspect(routeConfig));
    }

{'fraction_non_alphanumeric': 0.15789473684210525, 'fraction_numerical': 0.0012531328320802004, 'mean_word_length': 2.181274900398406, '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': '4171930', 'n_tokens_mistral': 486, 'n_tokens_neox': 475, 'n_words': 121}