source: tracformsplugin/tags/tracforms-0.4.1/0.11/tracforms/errors.py

Last change on this file was 10490, checked in by Steffen Hoffmann, 12 years ago

TracFormsPlugin: Release maintenance version 0.4.1 for compatibility with Trac 0.11, closes #9000.

These are changes cherry-picked from trunk and merged into tracforms-0.4 to
establish full compatibility with Trac 0.11 on level with plugin's own claims.

File size: 831 bytes
Line 
1# -*- coding: utf-8 -*-
2
3from api import _
4
5__all__ = ['FormError', 'FormTooManyValuesError',
6           'FormNoOperationError', 'FormNoCommandError']
7
8
9class FormError(Exception):
10    def __str__(self):
11        return self.message % self.args
12
13
14class FormTooManyValuesError(FormError):
15    def __init__(self, name):
16        FormError.__init__(self, name)
17
18    message = _(
19        """ERROR: Too many values for TracForms form variable %r
20        (maybe the same field is being used multiple times?)""")
21
22
23class FormNoOperationError(FormError):
24    def __init__(self, name):
25        FormError.__init__(self, name)
26
27    message = _("ERROR: No TracForms operation '%r'")
28
29
30class FormNoCommandError(FormError):
31    def __init__(self, name):
32        FormError.__init__(self, name)
33
34    message = _("ERROR: No TracForms command '%r'")
35
Note: See TracBrowser for help on using the repository browser.