1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
3 ;;; --- Resolver conditions.
6 (in-package :net.sockets
)
8 (define-condition resolver-error
()
9 ((datum :initarg
:data
:reader resolver-error-datum
))
11 "Signaled when an error occurs while trying to resolve an address."))
12 (setf (documentation 'resolver-error-datum
'function
)
13 "Return the datum that caused the signalling of a RESOLVER-ERROR condition.")
15 (defmacro define-resolver-error
(name format-string
&optional documentation
)
16 `(define-condition ,name
(resolver-error) ()
17 (:report
(lambda (condition stream
)
18 (format stream
,format-string
(resolver-error-datum condition
))))
19 (:documentation
,documentation
)))
21 (define-resolver-error resolver-again-error
22 "Temporary failure occurred while resolving: ~S"
23 "Condition signaled when a temporary failure occurred.")
25 (define-resolver-error resolver-fail-error
26 "Non recoverable error occurred while resolving: ~S"
27 "Condition signaled when a non-recoverable error occurred.")
29 (define-resolver-error resolver-no-name-error
30 "Host or service not found: ~S"
31 "Condition signaled when a host or service was not found.")
33 (define-resolver-error resolver-unknown-error
34 "Unknown error while resolving: ~S"
35 "Condition signaled when an unknown error is signaled while resolving