X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=openerp%2Fexceptions.py;h=7789345585c5095bb16d83a024a9582e7fa73df3;hb=a1e5f69cb3cf7cd36f2dc354392aa2367b9d018c;hp=c43f706fa616d11da4b3529b29b35be54d720fe2;hpb=9d8a2b9eb523d2676dd6ed06d550b96094086ffd;p=odoo%2Fodoo.git diff --git a/openerp/exceptions.py b/openerp/exceptions.py index c43f706..7789345 100644 --- a/openerp/exceptions.py +++ b/openerp/exceptions.py @@ -25,15 +25,21 @@ This module defines a few exception types. Those types are understood by the RPC layer. Any other exception type bubbling until the RPC layer will be treated as a 'Server error'. +If you consider introducing new exceptions, check out the test_exceptions addon. """ class Warning(Exception): pass -class WarningConfig(Exception): - """ Warning bound to a misconfiguration. """ - def __init__(self, msg): - super(WarningConfig, self).__init__(msg) +class RedirectWarning(Exception): + """ Warning with a possibility to redirect the user instead of simply + diplaying the warning message. + + Should receive as parameters: + :param int action_id: id of the action where to perform the redirection + :param string button_text: text to put on the button that will trigger + the redirection. + """ class AccessDenied(Exception): """ Login/password error. No message, no traceback. """