web/views/error.py
changeset 0 b97547f5f1fa
child 984 536e421b082b
equal deleted inserted replaced
-1:000000000000 0:b97547f5f1fa
       
     1 """Set of HTML errors views. Error view are generally implemented
       
     2 as startup views and are used for standard error pages (404, 500, etc.)
       
     3 
       
     4 :organization: Logilab
       
     5 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
       
     6 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
       
     7 """
       
     8 __docformat__ = "restructuredtext en"
       
     9 
       
    10 from cubicweb.common.view import StartupView
       
    11 
       
    12 class FourOhFour(StartupView):
       
    13     id = '404'
       
    14 
       
    15     def call(self):
       
    16         _ = self.req._
       
    17         self.w(u"<h1>%s</h1>" % _('this resource does not exist'))
       
    18 
       
    19 
       
    20 class ErrorOccured(StartupView):
       
    21     id = '500'
       
    22 
       
    23     def call(self):
       
    24         _ = self.req._
       
    25         self.w(u"<h1>%s</h1>" %
       
    26                _('an error occured, the request cannot be fulfilled'))
       
    27     
       
    28