Skip to content

Instantly share code, notes, and snippets.

/error.diff Secret

Created November 5, 2014 18:39
Show Gist options
  • Save anonymous/19cc5f9b6d24e3f81810 to your computer and use it in GitHub Desktop.
Save anonymous/19cc5f9b6d24e3f81810 to your computer and use it in GitHub Desktop.
diff --git a/lib/Mojo/IOLoop/Client.pm b/lib/Mojo/IOLoop/Client.pm
index f349873..9d17d65 100644
--- a/lib/Mojo/IOLoop/Client.pm
+++ b/lib/Mojo/IOLoop/Client.pm
@@ -81,7 +81,8 @@ sub _ready {
my $handle = $self->{handle};
return $! == EINPROGRESS ? undef : $self->emit(error => $!)
if $handle->isa('IO::Socket::IP') && !$handle->connect;
- return $self->emit(error => $! = $handle->sockopt(SO_ERROR))
+ return $self->emit(error => $!
+ = $handle->sockopt(SO_ERROR) || "Can't connect")
unless $handle->connected;
# Disable Nagle's algorithm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment