Unexpected unknown-condition · Issue #97 · usocket/usocket · GitHub
Skip to content

Unexpected unknown-condition #97

Description

@avodonosov

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions