Permalink
Browse files

no default timeout; show host/port in error; no close callback if err…

…or state
  • Loading branch information...
1 parent 20863cc commit ac2003e4a7ee917568fd3636220b233d5b78ed57 @tmm1 committed Aug 25, 2008
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/mongo/client.rb
View
@@ -9,10 +9,10 @@ def initialize opts = {}
@connected = false
@on_close = proc{
- raise Error, 'could not connect to server'
+ raise Error, "could not connect to server #{opts[:host]}:#{opts[:port]}"
}
- timeout opts[:timeout] || 0.5
+ timeout opts[:timeout] if opts[:timeout]
errback{ @on_close.call }
end
@@ -69,7 +69,7 @@ def receive_data data
def unbind
log 'disconnected'
@connected = false
- @on_close.call
+ @on_close.call unless $!
end
# connection

0 comments on commit ac2003e

Please sign in to comment.