Module: Semian::Rails::ClassMethods
- Defined in:
- lib/semian/rails.rb
Instance Method Summary collapse
-
#new_client(config) ⇒ Object
Translate ConnectionNotEstablished errors to their original cause if applicable.
Instance Method Details
#new_client(config) ⇒ Object
Translate ConnectionNotEstablished errors to their original cause if applicable. When we have a CircuitOpenErorr we don’t want the Active Record error, but rather the original cause.
13 14 15 16 17 18 19 20 21 |
# File 'lib/semian/rails.rb', line 13 def new_client(config) super rescue ActiveRecord::ConnectionNotEstablished => e if e.cause.is_a?(Mysql2::CircuitOpenError) raise e.cause else raise end end |