Browse files

Distinguish ConnectionNotEstablished messages: no conn pool for the c…

…lass, or no conn available from the pool
  • Loading branch information...
1 parent 467cb90 commit 58ba48e4b35c840f56b4fcbb6c8e4b489d785e15 @jeremy jeremy committed Feb 22, 2014
@@ -538,7 +538,10 @@ def clear_all_connections!
# for (not necessarily the current class).
def retrieve_connection(klass) #:nodoc:
pool = retrieve_connection_pool(klass)
- (pool && pool.connection) or raise ConnectionNotEstablished
+ raise ConnectionNotEstablished, "No connection pool for #{klass}" unless pool
+ conn = pool.connection
+ raise ConnectionNotEstablished, "No connection for #{klass} in connection pool" unless conn
+ conn
# Returns true if a connection that's accessible to this class has

0 comments on commit 58ba48e

Please sign in to comment.