Class: TranslationEngine::ConnectionExceptionMiddleware
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- TranslationEngine::ConnectionExceptionMiddleware
- Defined in:
- app/middlewares/translation_engine/connection_exception_middleware.rb
Instance Method Summary collapse
Instance Method Details
#call(env) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/middlewares/translation_engine/connection_exception_middleware.rb', line 5 def call(env) begin @app.call(env) rescue Faraday::Error => e = "Connecting to TranslationServer got #{e.class}: #{e.}" if TranslationEngine.raise_exceptions raise TranslationEngine::ConnectionError, else Rails.logger.error { } {} end end end |