anchor.diff:  (define-condition unknown-error (usocket-error)
     ((real-error :initarg :real-error
                  :accessor usocket-real-error))
  -  (:documentation ""))
  +  (:documentation "Error raised when there's no other - more applicable -
  +error available."))
   
  +
  +(define-usocket-condition-classes
  +  (ns-try-again)
  +  (ns-condition))
  +
  +(define-condition ns-unknown-condition (ns-condition)
  +  ((real-error :initarg :real-condition
  +               :accessor ns-real-condition))
  +  (:documentation "Condition raised when there's no other - more applicable -
  +condition available."))
  +
  +(define-usocket-condition-classes
  +  ;; the no-data error code in the Unix 98 api
  +  ;; isn't really an error: there's just no data to return.
  +  ;; with lisp, we just return NIL (indicating no data) instead of
  +  ;; raising an exception...
  +  (ns-host-not-found
  +   ns-no-recovery)
  +  (ns-error))
  +
  +(define-condition ns-unknown-error (ns-error)
  +  ((real-error :initarg :real-error
  +               :accessor ns-real-error))
  +  (:documentation "Error raised when there's no other - more applicable -
  +error available."))
   
   (defmacro with-mapped-conditions ((&optional socket) &body body)
     `(handler-case
  
positive.code: 
  (in-package :usocket)
  
  ;; (define-condition usocket-error (error)
  ;;   ((real-condition
  ;;     :reader real-condition
  ;;     :initarg :real-condition)
  ;;    (socket
  ;;     :reader socket
  ;;     :initarg :socket))
  ;;   (:report (lambda (c stream)
  ;;              (format stream "Error (~A) occured in socket: ~A."
  ;;                      (real-condition c) (socket c)))))
  
  (define-condition usocket-condition (condition)
    ((socket :initarg :socket
             :accessor usocket-socket))
    ;;###FIXME: no slots (yet); should at least be the affected usocket...
    (:documentation ""))
  
  (define-condition usocket-error (usocket-condition error)
    () ;; no slots (yet)
    (:documentation ""))
  
  
  
  (eval-when (:compile-toplevel :load-toplevel :execute)
    (defun define-usocket-condition-class (class &rest parents)
  
negative.code:     ((65 113) . host-unreachable-error)))
  
  
  (defun map-errno-condition (errno)
    (cdr (assoc errno +unix-errno-error-map+ :test #'member)))
  
  
  (defun map-errno-error (errno)
    (cdr (assoc errno +unix-errno-error-map+ :test #'member)))
  
  
  (defparameter +unix-ns-error-map+
    `((1 . ns-host-not-found-error)
      (2 . ns-try-again-condition)
      (3 . ns-no-recovery-error)))
  
  