예제 #1
0
 def internal_error(self, e):
     tmp_file = template.get_templatefile('500'+settings.GLOBAL.TEMPLATE_SUFFIX, self.template_dirs)
     if tmp_file:
         response = self.render(tmp_file, {'url':local.request.path}, status=500)
     else:
         response = e
     log.exception(e)
     return response
예제 #2
0
 def internal_error(self, e):
     tmp_file = template.get_templatefile('500'+settings.GLOBAL.TEMPLATE_SUFFIX, self.template_dirs)
     if tmp_file:
         response = self.render(tmp_file, {'url':local.request.path}, status=500)
     else:
         response = e
     log.exception(e)
     return response
예제 #3
0
 def not_found(self, e):
     if self.debug:
         urls = []
         for r in url_map.iter_rules():
             if r.methods:
                 methods = ' '.join(list(r.methods))
             else:
                 methods = ''
             urls.append((r.rule, methods, r.endpoint))
         urls.sort()
         return self._page_not_found(url=local.request.path, urls=urls)
     tmp_file = template.get_templatefile('404'+settings.GLOBAL.TEMPLATE_SUFFIX, self.template_dirs)
     if tmp_file:
         response = self.render(tmp_file, {'url':local.request.path}, status=404)
     else:
         response = e
     return response
예제 #4
0
 def not_found(self, e):
     if self.debug:
         urls = []
         for r in url_map.iter_rules():
             if r.methods:
                 methods = ' '.join(list(r.methods))
             else:
                 methods = ''
             urls.append((r.rule, methods, r.endpoint))
         urls.sort()
         return self._page_not_found(url=local.request.path, urls=urls)
     tmp_file = template.get_templatefile('404'+settings.GLOBAL.TEMPLATE_SUFFIX, self.template_dirs)
     if tmp_file:
         response = self.render(tmp_file, {'url':local.request.path}, status=404)
     else:
         response = e
     return response