summaryrefslogtreecommitdiff
path: root/core/lib
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-12-16 09:41:38 -0800
committerjessib <jessib@riseup.net>2013-12-16 09:41:38 -0800
commitdbb4030c87872550e03d1252ce2258f7cb1da6d9 (patch)
tree2028ea1c0aaf34d57834d39d44a4ffd314fb1a16 /core/lib
parente1d9d92d4afe32a6b4c267d9ffb7d8a40c4871e1 (diff)
parent72087656e5092fd744f4314c9a0e91825399fefc (diff)
Merge pull request #121 from azul/feature/robust-against-couch-connection-issues
Feature/robust against couch connection issues
Diffstat (limited to 'core/lib')
-rw-r--r--core/lib/extensions/couchrest.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/lib/extensions/couchrest.rb b/core/lib/extensions/couchrest.rb
index 84cfbb3..9f27c3a 100644
--- a/core/lib/extensions/couchrest.rb
+++ b/core/lib/extensions/couchrest.rb
@@ -23,10 +23,6 @@ module CouchRest
end
end
- module Errors
- class ConnectionFailed < CouchRestModelError; end
- end
-
module Connection
module ClassMethods
@@ -36,7 +32,9 @@ module CouchRest
rescue RestClient::Unauthorized,
Errno::EHOSTUNREACH,
Errno::ECONNREFUSED => e
- raise CouchRest::Model::Errors::ConnectionFailed.new(e.to_s)
+ message = "Could not connect to couch database #{db} due to #{e.to_s}"
+ Rails.logger.warn message
+ raise e.class.new(message) if APP_CONFIG[:reraise_errors]
end
end