Code like this
(ql:quickload "usocket")
(define-condition my-error (error) ())
(handler-case
(usocket:with-client-socket (socket stream "google.com" 443
:element-type '(unsigned-byte 8))
;; some my code
;; ...
(error 'my-error ))
(my-error (c)
;; handle my error
))
works fine on CCL, but suddenly fails on SBCL with usocket:unknown-error.
This happens because usocket:with-client-socket execudes the body inside of usocket:with-mapped-conditions, which on SBCL not only maps certain networking conditions to usocket portable conditions, but also captures all other errors and wraps them into usocket:unknown-error:
|
(signal 'unknown-condition |
So on CCL unknown conditions are allowed to pass through, while on SBCL all conditions are wrapped. That's inconsistent, or non-portable - code developed and tested on CCL surprisingly fails on SBCL.
Code like this
works fine on CCL, but suddenly fails on SBCL with
usocket:unknown-error.This happens because
usocket:with-client-socketexecudes the body inside ofusocket:with-mapped-conditions, which on SBCL not only maps certain networking conditions to usocket portable conditions, but also captures all other errors and wraps them intousocket:unknown-error:usocket/backend/sbcl.lisp
Line 310 in 79a3a56
So on CCL unknown conditions are allowed to pass through, while on SBCL all conditions are wrapped. That's inconsistent, or non-portable - code developed and tested on CCL surprisingly fails on SBCL.