docs: function handleError(routes, index, stage, e, location) {
  
          return loopThroughErrorHandlers(location, index)
  
  
          function loopThroughErrorHandlers(location, n) {
              if(n >= 0) {
                  var route = routes[n].route
                  if(route.errorHandler !== undefined) {
                      try {
                          var result = route.errorHandler(e, {stage: stage, location: location})
                      } catch(e) {
                          var result = new Future
                          result.throw(e)
                      }
  
                      if(result === undefined) {
                          result = Future(undefined)
                      }
  
                      return result.catch(function(e) {
                          if(index > 0) {
                              return handleError(routes, n-1, stage, e, route.pathSegment)
                          } else {
                              throw e // ran out of error handlers
                          }
                      })
                  } else {
                      return loopThroughErrorHandlers(route.pathSegment.concat(location), n-1)
                  }
              } else {
                  var f = new Future
                  f.throw(e)
                  return f
              }
          }
      }