Skip to content

Commit

Permalink
Handle Errno::EHOSTUNREACH in socket errors. [ fix mongoid#75 ]
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Sep 23, 2012
1 parent 93d70d4 commit 2321c26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@

### Resolved Issues

* Sockets now set TCP `SO_LINGER` option to false to ensure connections that are no
longer used get closed.

* \#75 Ensure that `Errno::EHOSTUNREACH` is also handled with other socket errors.

## 1.2.2

### Resolved Issues
Expand Down
2 changes: 1 addition & 1 deletion lib/moped/sockets/connectable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def handle_socket_errors
yield
rescue Timeout::Error
raise Errors::ConnectionFailure, "Timed out connection to Mongo on #{host}:#{port}"
rescue Errno::ECONNREFUSED
rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH
raise Errors::ConnectionFailure, "Could not connect to Mongo on #{host}:#{port}"
rescue Errno::ECONNRESET
raise Errors::ConnectionFailure, "Connection reset to Mongo on #{host}:#{port}"
Expand Down

0 comments on commit 2321c26

Please sign in to comment.