Turn error hierarchie upside down.

This commit is contained in:
mainzelm 2002-09-16 16:16:04 +00:00
parent f6d1babc7b
commit e8463d7005
1 changed files with 22 additions and 22 deletions

View File

@ -90,56 +90,56 @@
;; --- error conditions
(define-condition-type 'invalid-type '())
;; supertype of all errors signaled by this library
(define-condition-type 'dns-error '(error))
(define dns-error? (condition-predicate 'dns-error))
(define-condition-type 'invalid-type '(dns-error))
(define invalid-type? (condition-predicate 'invalid-type))
(define-condition-type 'invalid-class '())
(define-condition-type 'invalid-class '(dns-error))
(define invalid-class? (condition-predicate 'invalid-class))
(define-condition-type 'parse-error '())
(define-condition-type 'parse-error '(dns-error))
(define parse-error? (condition-predicate 'parse))
(define-condition-type 'unexpected-eof-from-server '())
(define-condition-type 'unexpected-eof-from-server '(dns-error))
(define unexpected-eof-from-server? (condition-predicate 'unexpected-eof-from-server))
(define-condition-type 'bad-address '())
(define-condition-type 'bad-address '(dns-error))
(define bad-address? (condition-predicate 'bad-address))
(define-condition-type 'no-nameservers '())
(define-condition-type 'no-nameservers '(dns-error))
(define no-nameservers? (condition-predicate 'no-nameservers))
(define-condition-type 'not-a-hostname '())
(define-condition-type 'not-a-hostname '(dns-error))
(define not-a-hostname? (condition-predicate 'not-a-hostname))
(define-condition-type 'not-a-ip '())
(define-condition-type 'not-a-ip '(dns-error))
(define not-a-ip? (condition-predicate 'not-a-ip))
;; supertype of all errors signaled if the dns server returned a non-sero
;; reply code
(define-condition-type 'dns-server-error '(dns-error))
(define dns-server-error? (condition-predicate 'dns-server-error))
(define-condition-type 'dns-format-error '())
(define-condition-type 'dns-format-error '(dns-server-error))
(define dns-format-error? (condition-predicate 'dns-format-error))
(define-condition-type 'dns-server-failure '())
(define-condition-type 'dns-server-failure '(dns-server-error))
(define dns-server-failure? (condition-predicate 'dns-server-failure))
(define-condition-type 'dns-name-error '())
(define-condition-type 'dns-name-error '(dns-server-error))
(define dns-name-error? (condition-predicate 'dns-name-error))
(define-condition-type 'dns-not-implemented '())
(define-condition-type 'dns-not-implemented '(dns-server-error))
(define dns-not-implemented? (condition-predicate 'dns-not-implemented))
(define-condition-type 'dns-refused '())
(define-condition-type 'dns-refused '(dns-server-error))
(define dns-refused? (condition-predicate 'dns-refused))
(define-condition-type 'dns-error '(dns-format-error
dns-server-failure
dns-name-error
dns-not-implemented
dns-refused))
(define dns-error? (condition-predicate 'dns-error))
;; called by the error-handlers, prints out error descriptions
(define (dns-error-messages condition more)
(display "dns-error: ")