forked from death/dbus
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconditions.lisp
31 lines (25 loc) · 1.27 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
;;;; +----------------------------------------------------------------+
;;;; | DBUS DEATH, 2010-2011 |
;;;; +----------------------------------------------------------------+
(in-package #:dbus)
;;;; Condition types
(define-condition dbus-error (error)
()
(:documentation "The supertype for errors related to the DBUS
system."))
(define-condition authentication-error (dbus-error)
((command :initarg :command :reader authentication-error-command)
(argument :initarg :argument :reader authentication-error-argument))
(:report (lambda (condition stream)
(format stream "Authentication error, command ~S with argument ~S."
(authentication-error-command condition)
(authentication-error-argument condition)))))
(define-condition method-error (dbus-error)
((arguments :initarg :arguments :reader method-error-arguments))
(:report (lambda (condition stream)
(format stream "Method error: ~S."
(let ((all-args (method-error-arguments condition))
(first-arg (first (method-error-arguments condition))))
(if (stringp first-arg)
first-arg
all-args))))))