[IMP] we don't need a special type of exception anymore
bzr revid: abo@openerp.com-20130124154119-5283u6x1it5xvt0r
This commit is contained in:
parent
28960472df
commit
59dc49061c
|
@ -622,7 +622,7 @@ class res_config_settings(osv.osv_memory):
|
|||
|
||||
def get_warning_config(cr, msg, context=None):
|
||||
"""
|
||||
Helper: return a WarningConfig exception with the given message where the
|
||||
Helper: return a Warning exception with the given message where the
|
||||
%(field:)s and/or %(menu:)s are replaced by the human readable field's name
|
||||
and/or menuitem's full path.
|
||||
|
||||
|
@ -658,6 +658,6 @@ def get_warning_config(cr, msg, context=None):
|
|||
values[item] = res_config_obj.get_option_name(cr, SUPERUSER_ID, ref, context)
|
||||
|
||||
# 4/ substitute and return the result
|
||||
return exceptions.WarningConfig(msg % values)
|
||||
return exceptions.Warning(msg % values)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -30,11 +30,6 @@ treated as a 'Server error'.
|
|||
class Warning(Exception):
|
||||
pass
|
||||
|
||||
class WarningConfig(Exception):
|
||||
""" Warning bound to a misconfiguration. """
|
||||
def __init__(self, msg):
|
||||
super(WarningConfig, self).__init__(msg)
|
||||
|
||||
class AccessDenied(Exception):
|
||||
""" Login/password error. No message, no traceback. """
|
||||
def __init__(self):
|
||||
|
|
|
@ -306,8 +306,6 @@ def dispatch_rpc(service_name, method, params):
|
|||
raise
|
||||
except openerp.exceptions.Warning:
|
||||
raise
|
||||
except openerp.exceptions.WarningConfig:
|
||||
raise
|
||||
except openerp.exceptions.DeferredException, e:
|
||||
_logger.exception(tools.exception_to_unicode(e))
|
||||
post_mortem(e.traceback)
|
||||
|
|
|
@ -170,8 +170,6 @@ def netrpc_handle_exception_legacy(e):
|
|||
return 'warning -- ' + e.name + '\n\n' + e.value
|
||||
if isinstance(e, openerp.exceptions.Warning):
|
||||
return 'warning -- Warning\n\n' + str(e)
|
||||
if isinstance(e, openerp.exceptions.WarningConfig):
|
||||
return 'warning -- Warning\n\n' + str(e)
|
||||
if isinstance(e, openerp.exceptions.AccessError):
|
||||
return 'warning -- AccessError\n\n' + str(e)
|
||||
if isinstance(e, openerp.exceptions.AccessDenied):
|
||||
|
|
|
@ -95,9 +95,6 @@ def xmlrpc_handle_exception(e):
|
|||
response = xmlrpclib.dumps(fault, allow_none=False, encoding=None)
|
||||
elif isinstance(e, openerp.exceptions.Warning):
|
||||
fault = xmlrpclib.Fault(RPC_FAULT_CODE_WARNING, str(e))
|
||||
elif isinstance(e, openerp.exceptions.WarningConfig):
|
||||
fault = xmlrpclib.Fault(RPC_FAULT_CODE_WARNING, str(e))
|
||||
response = xmlrpclib.dumps(fault, allow_none=False, encoding=None)
|
||||
elif isinstance (e, openerp.exceptions.AccessError):
|
||||
fault = xmlrpclib.Fault(RPC_FAULT_CODE_ACCESS_ERROR, str(e))
|
||||
response = xmlrpclib.dumps(fault, allow_none=False, encoding=None)
|
||||
|
|
Loading…
Reference in New Issue