1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Indent-tabs-mode: NIL -*-
3 ;;; conditions.lisp --- Resolver conditions.
5 ;;; Copyright (C) 2006-2008, Stelian Ionescu <sionescu@common-lisp.net>
7 ;;; This code is free software; you can redistribute it and/or
8 ;;; modify it under the terms of the version 2.1 of
9 ;;; the GNU Lesser General Public License as published by
10 ;;; the Free Software Foundation, as clarified by the
11 ;;; preamble found here:
12 ;;; http://opensource.franz.com/preamble.html
14 ;;; This program is distributed in the hope that it will be useful,
15 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU Lesser General
20 ;;; Public License along with this library; if not, write to the
21 ;;; Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
22 ;;; Boston, MA 02110-1301, USA
24 (in-package :net.sockets
)
26 (define-condition resolver-error
()
27 ((data :initarg
:data
:reader resolver-error-data
))
29 "Signaled when an error occurs while trying to resolve an address."))
31 (defmacro define-resolver-error
(name format-string
&optional documentation
)
32 `(define-condition ,name
(resolver-error) ()
33 (:report
(lambda (condition stream
)
34 (format stream
,format-string
(resolver-error-data condition
))))
35 (:documentation
,documentation
)))
37 (define-resolver-error resolver-again-error
38 "Temporary failure occurred while resolving: ~S"
39 "Condition signaled when a temporary failure occurred.")
41 (define-resolver-error resolver-fail-error
42 "Non recoverable error occurred while resolving: ~S"
43 "Condition signaled when a non-recoverable error occurred.")
45 (define-resolver-error resolver-no-name-error
46 "Host or service not found: ~S"
47 "Condition signaled when a host or service was not found.")
49 (define-resolver-error resolver-unknown-error
50 "Unknown error while resolving: ~S"
51 "Condition signaled when an unknown error is signaled while resolving