1 | ;;+----------------------------------------------------------------------------- |
---|
2 | ;;+ Isidorus |
---|
3 | ;;+ (c) 2008-2009 Marc Kuester, Christoph Ludwig, Lukas Giessmann |
---|
4 | ;;+ |
---|
5 | ;;+ Isidorus is freely distributable under the LGPL license. |
---|
6 | ;;+ You can find a detailed description in trunk/docs/LGPL-LICENSE.txt. |
---|
7 | ;;+----------------------------------------------------------------------------- |
---|
8 | |
---|
9 | |
---|
10 | (defpackage :exceptions |
---|
11 | (:use :common-lisp) |
---|
12 | (:export :inconsistent-file-error |
---|
13 | :missing-reference-error |
---|
14 | :no-identifier-error |
---|
15 | :duplicate-identifier-error |
---|
16 | :object-not-found-error |
---|
17 | :not-mergable-error |
---|
18 | :missing-argument-error |
---|
19 | :tm-reference-error)) |
---|
20 | |
---|
21 | (in-package :exceptions) |
---|
22 | |
---|
23 | (define-condition inconsistent-file-error(error) |
---|
24 | ((message |
---|
25 | :initarg :message |
---|
26 | :accessor message))) |
---|
27 | |
---|
28 | |
---|
29 | (define-condition missing-reference-error(error) |
---|
30 | ((message |
---|
31 | :initarg :message |
---|
32 | :accessor message) |
---|
33 | (reference |
---|
34 | :accessor reference |
---|
35 | :initarg :reference)) |
---|
36 | (:documentation "thrown is a reference is missing")) |
---|
37 | |
---|
38 | |
---|
39 | (define-condition duplicate-identifier-error(error) |
---|
40 | ((message |
---|
41 | :initarg :message |
---|
42 | :accessor message) |
---|
43 | (uri |
---|
44 | :accessor reference |
---|
45 | :initarg :reference)) |
---|
46 | (:documentation "thrown if the same identifier is already in use")) |
---|
47 | |
---|
48 | |
---|
49 | (define-condition object-not-found-error(error) |
---|
50 | ((message |
---|
51 | :initarg :message |
---|
52 | :accessor message)) |
---|
53 | (:documentation "thrown if the object could not be found")) |
---|
54 | |
---|
55 | |
---|
56 | (define-condition no-identifier-error(error) |
---|
57 | ((message |
---|
58 | :initarg :message |
---|
59 | :accessor message) |
---|
60 | (internal-id |
---|
61 | :initarg :internal-id |
---|
62 | :accessor internal-id)) |
---|
63 | (:documentation "thrown if the topic has no identifier")) |
---|
64 | |
---|
65 | |
---|
66 | (define-condition not-mergable-error (error) |
---|
67 | ((message |
---|
68 | :initarg :message |
---|
69 | :accessor message) |
---|
70 | (construc-1 |
---|
71 | :initarg :construct-1 |
---|
72 | :accessor construct-1) |
---|
73 | (construc-2 |
---|
74 | :initarg :construct-2 |
---|
75 | :accessor construct-2)) |
---|
76 | (:documentation "Thrown if two constructs are not mergable since |
---|
77 | they have e.g. difference types.")) |
---|
78 | |
---|
79 | |
---|
80 | (define-condition missing-argument-error (error) |
---|
81 | ((message |
---|
82 | :initarg :message |
---|
83 | :accessor message) |
---|
84 | (argument-symbol |
---|
85 | :initarg :argument-symbol |
---|
86 | :accessor argument-symbol) |
---|
87 | (function-symbol |
---|
88 | :initarg :function-symbol |
---|
89 | :accessor function-symbol)) |
---|
90 | (:documentation "Thrown if a argument is missing in a function.")) |
---|
91 | |
---|
92 | |
---|
93 | (define-condition tm-reference-error (error) |
---|
94 | ((message |
---|
95 | :initarg :message |
---|
96 | :accessor message) |
---|
97 | (referenced-construct |
---|
98 | :initarg :referenced-construct |
---|
99 | :accessor referenced-construct) |
---|
100 | (existing-reference |
---|
101 | :initarg :existing-reference |
---|
102 | :accessor existing-reference) |
---|
103 | (new-reference |
---|
104 | :initarg :new-reference |
---|
105 | :accessor new-reference)) |
---|
106 | (:documentation "Thrown of the referenced-construct is already owned by another |
---|
107 | TM-construct (existing-reference) and is going to be referenced |
---|
108 | by a second TM-construct (new-reference) at the same time.")) |
---|