2014-12-02 12:54:01 +01:00
|
|
|
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
|
|
|
|
# this repository contains the full copyright notices and license terms.
|
2011-09-06 11:20:34 +02:00
|
|
|
|
2012-04-01 23:08:15 +02:00
|
|
|
|
2016-03-15 16:57:26 +01:00
|
|
|
class TrytonException(Exception):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UserError(TrytonException):
|
2011-09-06 11:20:34 +02:00
|
|
|
|
|
|
|
|
def __init__(self, message, description=''):
|
|
|
|
|
super(UserError, self).__init__('UserError', (message, description))
|
|
|
|
|
self.message = message
|
|
|
|
|
self.description = description
|
|
|
|
|
self.code = 1
|
|
|
|
|
|
|
|
|
|
|
2016-03-15 16:57:26 +01:00
|
|
|
class UserWarning(TrytonException):
|
2011-09-06 11:20:34 +02:00
|
|
|
|
|
|
|
|
def __init__(self, name, message, description=''):
|
|
|
|
|
super(UserWarning, self).__init__('UserWarning', (name, message,
|
|
|
|
|
description))
|
|
|
|
|
self.name = name
|
|
|
|
|
self.message = message
|
|
|
|
|
self.description = description
|
|
|
|
|
self.code = 2
|
|
|
|
|
|
|
|
|
|
|
2016-03-15 16:57:26 +01:00
|
|
|
class ConcurrencyException(TrytonException):
|
2011-09-06 11:20:34 +02:00
|
|
|
|
|
|
|
|
def __init__(self, message):
|
|
|
|
|
super(ConcurrencyException, self).__init__('ConcurrencyException',
|
|
|
|
|
message)
|
|
|
|
|
self.message = message
|
|
|
|
|
self.code = 4
|