Skip to content

Commit

Permalink
Prevent connection errors from messing up /servers response
Browse files Browse the repository at this point in the history
  • Loading branch information
bobthecow committed Nov 12, 2012
1 parent b61fab8 commit d46d54f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v2.1.5

* Prevent connection errors from messing up `/servers` response (Ruby backend) — See #46


## v2.1.4

* Add warning messages for `magic_quotes_gpc` and `magic_quotes_runtime` — See #49.
Expand Down
2 changes: 2 additions & 0 deletions genghis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ def to_json(*)

def connection
@connection ||= Mongo::Connection.from_uri(@dsn, :connect_timeout => 1)
rescue StandardError => e
raise Mongo::ConnectionFailure.new(e.message)
end

def info
Expand Down
2 changes: 2 additions & 0 deletions src/rb/genghis/models/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def to_json(*)

def connection
@connection ||= Mongo::Connection.from_uri(@dsn, :connect_timeout => 1)
rescue StandardError => e
raise Mongo::ConnectionFailure.new(e.message)
end

def info
Expand Down

0 comments on commit d46d54f

Please sign in to comment.