Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes
MoinMoin.web.exceptions.SurgeProtection Class Reference
Collaboration diagram for MoinMoin.web.exceptions.SurgeProtection:
Collaboration graph

List of all members.

Public Member Functions

def __init__
def get_headers

Public Attributes


Static Public Attributes

string name = 'Surge protection'
tuple description

Detailed Description

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.

Definition at line 15 of file

Constructor & Destructor Documentation

def MoinMoin.web.exceptions.SurgeProtection.__init__ (   self,
  description = None,
  retry_after = 3600 

Definition at line 29 of file

00030     def __init__(self, description=None, retry_after=3600):
00031         exceptions.ServiceUnavailable.__init__(self, description)
00032         self.retry_after = retry_after

Member Function Documentation

Definition at line 33 of file

00034     def get_headers(self, environ):
00035         headers = exceptions.ServiceUnavailable.get_headers(self, environ)
00036         headers.append(('Retry-After', '%d' % self.retry_after))
00037         return headers

Member Data Documentation

Initial value:
        "<p>You triggered the wiki's surge protection by doing too many requests in a short time.</p>"
        "<p>Please make a short break reading the stuff you already got.</p>"
        "<p>When you restart doing requests AFTER that, slow down or you might get locked out for a longer time!</p>"

Definition at line 22 of file

string = 'Surge protection' [static]

Definition at line 21 of file

Definition at line 31 of file

The documentation for this class was generated from the following file: