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
[legend]

List of all members.

Public Member Functions

def __init__
def get_headers

Public Attributes

 retry_after

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 exceptions.py.


Constructor & Destructor Documentation

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

Definition at line 29 of file exceptions.py.

00029 
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 exceptions.py.

00033 
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:
(
        "<strong>Warning:</strong>"
        "<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 exceptions.py.

string MoinMoin.web.exceptions.SurgeProtection.name = 'Surge protection' [static]

Definition at line 21 of file exceptions.py.

Definition at line 31 of file exceptions.py.


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