source: trunk/src/model/exceptions.lisp

Last change on this file was 430, checked in by lgiessmann, 14 years ago

JTM: added a jtm-exporter that offers the exporting of JTM 1.0 and 1.1 files

  • Property svn:eol-style set to native
File size: 3.8 KB
Line 
1;;+-----------------------------------------------------------------------------
2;;+  Isidorus
3;;+  (c) 2008-2010 Marc Kuester, Christoph Ludwig, Lukas Georgieff
4;;+
5;;+  Isidorus is freely distributable under the LLGPL license.
6;;+  You can find a detailed description in trunk/docs/LLGPL-LICENSE.txt and
7;;+  trunk/docs/LGPL-LICENSE.txt.
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           :bad-type-error
21           :sparql-parser-error
22           :bad-argument-error
23           :JTM-error))
24
25(in-package :exceptions)
26
27
28(define-condition bad-argument-error(error)
29  ((message 
30    :initarg :message
31    :accessor message)))
32
33
34(define-condition sparql-parser-error(error)
35  ((message
36    :initarg :message
37    :accessor message)))
38
39
40(define-condition inconsistent-file-error(error)
41  ((message
42    :initarg :message
43    :accessor message)))
44
45
46(define-condition missing-reference-error(error)
47  ((message
48    :initarg :message
49    :accessor message)
50   (reference 
51    :accessor reference
52    :initarg :reference))
53  (:documentation "thrown is a reference is missing"))
54
55
56(define-condition duplicate-identifier-error(error)
57  ((message
58    :initarg :message
59    :accessor message)
60   (uri
61    :accessor reference
62    :initarg :reference))
63  (:documentation "thrown if the same identifier is already in use"))
64
65
66(define-condition object-not-found-error(error)
67  ((message
68    :initarg :message
69    :accessor message))
70  (:documentation "thrown if the object could not be found"))
71
72
73(define-condition no-identifier-error(error)
74  ((message
75    :initarg :message
76    :accessor message)
77   (internal-id 
78    :initarg :internal-id
79    :accessor internal-id))
80  (:documentation "thrown if the topic has no identifier"))
81
82
83(define-condition not-mergable-error (error)
84  ((message
85    :initarg :message
86    :accessor message)
87   (construc-1
88    :initarg :construct-1
89    :accessor construct-1)
90   (construc-2
91    :initarg :construct-2
92    :accessor construct-2))
93  (:documentation "Thrown if two constructs are not mergable since
94                   they have e.g. difference types."))
95
96
97(define-condition missing-argument-error (error)
98  ((message
99    :initarg :message
100    :accessor message)
101   (argument-symbol
102    :initarg :argument-symbol
103    :accessor argument-symbol)
104   (function-symbol
105    :initarg :function-symbol
106    :accessor function-symbol))
107  (:documentation "Thrown if a argument is missing in a function."))
108
109
110(define-condition tm-reference-error (error)
111  ((message
112    :initarg :message
113    :accessor message)
114   (referenced-construct
115    :initarg :referenced-construct
116    :accessor referenced-construct)
117   (existing-reference
118    :initarg :existing-reference
119    :accessor existing-reference)
120   (new-reference
121    :initarg :new-reference
122    :accessor new-reference))
123  (:documentation "Thrown if the referenced-construct is already owned by another
124                   TM-construct (existing-reference) and is going to be referenced
125                   by a second TM-construct (new-reference) at the same time."))
126
127
128(define-condition bad-type-error (error)
129  ((message
130    :initarg :message
131    :accessor message)
132   (expected-type
133    :initarg :expected-type
134    :accessor expected-type)
135   (result-object
136    :initarg :result-object
137    :accessor result-object))
138  (:documentation "Thrown if a bad result object with respect to the expected
139                   type was found."))
140
141
142(define-condition JTM-error (error)
143  ((message :initarg :message
144            :accessor message))
145  (:documentation "Thrown if any error occurs during JTM serialisation
146                   or deserialisation."))
Note: See TracBrowser for help on using the repository browser.