-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexceptions.py
48 lines (34 loc) · 1.32 KB
/
exceptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#coding: UTF-8
"""
All the exceptions thrown by the hist application.
Those exceptions are part of the API.
@author: Marc-Antoine Gouillart
@copyright: Marc-Antoine Gouillart, 2009
@license: GNU GPL v3
"""
class HistoryException(Exception):
pass
class DeletedObject(HistoryException):
def __init__(self, history_object):
self.history_object = history_object
def __str__(self):
return 'L\'objet %s de l\'historique ne correspond plus a un objet actif' %self.history_object
class NoHistoryModel(HistoryException):
def __init__(self, instance):
self.instance = instance
def __str__(self):
return 'L\'objet %s n\'est pas suivi en modifications' %self.instance
class UnknownVersion(HistoryException):
def __init__(self, instance, version):
self.instance = instance
self.version = version
def __str__(self):
return 'L\'objet %s n\'a pas de version %s' %(self.instance, self.version)
class UndiffableObject(HistoryException):
def __init__(self, instance):
self.instance = instance
def __str__(self):
return 'L\'objet %s n\'est pas diffable (non encore sauvegarde ou non suivi en version)' %self.instance
class WontCopy(HistoryException):
def __str__(self):
return u'Ne sera pas copie'