changeset 4307:dca46d0c55f6

Code review: added doc strings, remove unused exception
author Florian Krupicka <florian.krupicka@googlemail.com>
date Thu, 14 Aug 2008 17:25:20 +0200
parents d289ebf95f8f
children 3a4426122606
files MoinMoin/web/exceptions.py
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/web/exceptions.py	Thu Aug 14 17:10:05 2008 +0200
+++ b/MoinMoin/web/exceptions.py	Thu Aug 14 17:25:20 2008 +0200
@@ -2,6 +2,8 @@
 """
     MoinMoin - HTTP exceptions
 
+    Customization of werkzeug.exceptions classes for use in MoinMoin.
+
     @copyright: 2008-2008 MoinMoin:FlorianKrupicka
     @license: GNU GPL, see COPYING for details.
 """
@@ -9,6 +11,11 @@
 from werkzeug import exceptions
 
 class SurgeProtection(exceptions.ServiceUnavailable):
+    """ A surge protection error in MoinMoin is based on the HTTP status
+    `Service Unavailable`. This HTTP exception gives a short description
+    on what triggered the surge protection mechanism to the user.
+    """
+
     name = 'Surge protection'
     description = (
         "<strong>Warning:</strong>"
@@ -27,7 +34,11 @@
         return headers
 
 class Forbidden(exceptions.Forbidden):
+    """
+    Override the default description of werkzeug.exceptions.Forbidden to a
+    less technical sounding one.
+    """
     description = "<p>You are not allowed to access this!</p>"
 
-class PageNotFound(exceptions.NotFound):
-    pass
+# handy exception raising
+abort = exceptions.abort