def respond
      inner_error = nil
      rescue_block = proc do |e|
        (env['rack.exception'] = e && raise) unless filters[:error].any? do |f|
          if !f[:args] || f[:args].empty? || f[:args].any? { |type| e.is_a?(type) }
            instance_exec(e, &f[:proc]) unless check_for_failed_condition(f[:conditions])
          end
        end
      end

      begin
        if config[:strip_trailing_slash] == :redirect && request.path =~ %r{[^/]/+$}
          query_string = request.query_string.empty? ? '' : '?' << request.query_string
          redirect(request.path.chomp('/') + query_string, status: 307, halt: false)
          return response.finish
        end
        pass if config[:auto_pass] && eligable_matches.empty?

        if run_filters(:before)
          catch(:halt) {
            begin
              try_matches
            rescue => inner_error
              rescue_block.call(inner_error)
            end
          }
        end
        run_filters(:after)
      rescue => outer_error
        outer_error == inner_error ? raise : catch(:halt) { rescue_block.call(outer_error) }
      end
      response.finish
    end
def respond
      inner_error = nil
      rescue_block = proc do |e|
        (env['rack.exception'] = e && raise) unless filters[:error].any? do |f|
          if !f[:args] || f[:args].empty? || f[:args].any? { |type| e.is_a?(type) }
            instance_exec(e, &f[:proc]) unless check_for_failed_condition(f[:conditions])
          end
        end
      end

      begin
        if config[:strip_trailing_slash] == :redirect && request.path =~ %r{[^/]/+$}
          query_string = request.query_string.empty? ? '' : '?' << request.query_string
          redirect(request.path.chomp('/') + query_string, status: 307, halt: false)
          return response.finish
        end
        pass if config[:auto_pass] && eligable_matches.empty?

        if run_filters(:before)
          catch(:halt) {
            begin
              try_matches
            rescue => inner_error
              rescue_block.call(inner_error)
            end
          }
        end
        run_filters(:after)
      rescue => outer_error
        outer_error == inner_error ? raise : catch(:halt) { rescue_block.call(outer_error) }
      end
      response.finish
    end
This is where the magic happens. Applies filters, matches mappings, applies error handlers, catches :halt and
 :pass, etc.
 Returns a rack-compatible tuple