-
Notifications
You must be signed in to change notification settings - Fork 29
/
conditions.lisp
83 lines (71 loc) · 2.95 KB
/
conditions.lisp
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
(in-package :graph-db)
(define-condition slave-auth-error (error)
((reason :initarg :reason)
(host :initarg :host))
(:report (lambda (error stream)
(with-slots (reason host) error
(format stream "Slave auth error ~A: ~A." host reason)))))
(define-condition transaction-error (error)
((reason :initarg :reason))
(:report (lambda (error stream)
(with-slots (reason) error
(format stream "Transaction error: ~A." reason)))))
(define-condition serialization-error (error)
((instance :initarg :instance)
(reason :initarg :reason))
(:report (lambda (error stream)
(with-slots (instance reason) error
(format stream "Serialization failed for ~a because of ~a."
instance reason)))))
(define-condition deserialization-error (error)
((instance :initarg :instance)
(reason :initarg :reason))
(:report (lambda (error stream)
(with-slots (instance reason) error
(format stream "Deserialization failed for ~a because of ~a."
instance reason)))))
(define-condition stale-revision-error (error)
((instance :initarg :instance)
(current-revision :initarg :current-revision))
(:report (lambda (error stream)
(with-slots (instance current-revision) error
(format stream "Attempt to update stale revision ~S of ~S."
instance current-revision)))))
(define-condition duplicate-key-error (error)
((instance :initarg :instance)
(key :initarg :key))
(:report (lambda (error stream)
(with-slots (instance key) error
(format stream "Duplicate key ~S in ~S."
key instance)))))
(define-condition nonexistent-key-error (error)
((instance :initarg :instance)
(key :initarg :key))
(:report (lambda (error stream)
(with-slots (instance key) error
(format stream "Nonexistent key ~S in ~S."
key instance)))))
(define-condition node-already-deleted-error (error)
((node :initarg :node))
(:report (lambda (error stream)
(with-slots (node) error
(format stream "Node ~A already deleted" node)))))
(define-condition vertex-already-deleted-error (node-already-deleted-error)
())
(define-condition edge-already-deleted-error (node-already-deleted-error)
())
(define-condition invalid-view-error (error)
((class-name :initarg :class-name)
(view-name :initarg :view-name))
(:report (lambda (error stream)
(with-slots (class-name view-name) error
(format stream
"No such graph view: ~A/~A"
class-name view-name)))))
(define-condition view-lock-error (error)
((message :initarg :message))
(:report (lambda (error stream)
(with-slots (message) error
(format stream
"View locking error: '~A'"
message)))))