def dispatch_request(self, request):
        try:
            try:
                request_rule = request.rule
                for rule_tuple in self.url_map[request.method]:
                    match = rule_tuple[0].search(request_rule)
                    if match is not None:
                        view = rule_tuple[2]
                        return view(request, **match.groupdict())
            except KeyError:
                raise HTTPException(404)
            else:
                raise HTTPException(404)
        except HTTPException, e:
            if e.code in self.error_handler:
                view = self.error_handler[e.code]
                e_response = Response(view())
                e_response.set_status(e.code)
                return e_response
            else:
                return e
dataset/ETHPy150Open fengsp/batpod/batpod.py/BatPod.dispatch_request/original