Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Specify Error in #close_cb #9

Open
HoneyryderChuck opened this issue Oct 13, 2017 · 0 comments
Open

Feature Request: Specify Error in #close_cb #9

HoneyryderChuck opened this issue Oct 13, 2017 · 0 comments

Comments

@HoneyryderChuck
Copy link

Currently #close_cb is being used as general purpose callback for when something wrong happens and ssl session terminates. This "something wrong" are, from what I saw, standard SSL/TLS errors, and could be handled differently, in a more "ruby way".

My proposal would be: wrap those errors into exception objects (the equivalent to OpenSSL::SSL::SSLError, hopefully with better error messages). After that, one would have two options:

  • raise the exception (perform ssl session cleanups in an ensure block); remove the #close_cb need.
  • pass the exception to the #close_cb callback as argument, and let the user decide what to do with it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant