igrigorik/em-socksify — pull request #5 by meh (2012-03-28 21:32:48+00:00)
Title: Add catchable error handling

I was having some issues dealing with SOCKS errors, now errors will be handled by the passed block.

Now it works like this:

```ruby
socksify('google.ca', 80) do |e|
if socks_error?
# do something with the exception
else
send_data "GET / HTTP/1.1\r\nConnection:close\r\nHost: google.ca\r\n\r\n"
end
end
```

You can also pass true as the last argument of `socksify` to force it to raise instead of passing the exception to the callback.

If you have any better idea to deal with this I'll be glad to implement it.

I also think we should add the chance to pass an Hash instead of `username, password, version, always_raise`, I will open a different pull request for that though.