Use python logging in install / log cherrypy at right severity
[cascardo/ipsilon.git] / ipsilon / util / errors.py
old mode 100755 (executable)
new mode 100644 (file)
index 3d7ea28..7017a1b
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-#
 # Copyright (C) 2014  Simo Sorce <simo@redhat.com>
 #
 # see file 'COPYING' for use and warranty information
@@ -33,7 +31,7 @@ class Errors(Page):
         return str(output_page)
 
     def handler(self, status, message, traceback, version):
-        self._debug(repr([status, message, traceback, version]))
+        self.debug(repr([status, message, traceback, version]))
         return self._error_template('internalerror.html',
                                     title='Internal Error')
 
@@ -54,3 +52,10 @@ class Error_401(Errors):
     def handler(self, status, message, traceback, version):
         return self._error_template('unauthorized.html',
                                     title='Unauthorized', message=message)
+
+
+class Error_404(Errors):
+
+    def handler(self, status, message, traceback, version):
+        return self._error_template('notfound.html',
+                                    title='Not Found', message=message)