Class: TxghQueue::ErrorHandlers::Transifex
- Inherits:
-
Object
- Object
- TxghQueue::ErrorHandlers::Transifex
- Defined in:
- lib/txgh-queue/error_handlers/transifex.rb
Constant Summary collapse
- ERROR_CLASSES =
{ Txgh::TransifexApiError => Status.retry_with_delay, Txgh::TransifexNotFoundError => Status.fail, Txgh::TransifexUnauthorizedError => Status.fail }
Class Method Summary collapse
Class Method Details
.can_handle?(error_or_response) ⇒ Boolean
13 14 15 |
# File 'lib/txgh-queue/error_handlers/transifex.rb', line 13 def can_handle?(error_or_response) ERROR_CLASSES.any? { |klass, _| error_or_response.class <= klass } end |
.status_for(error) ⇒ Object
17 18 19 |
# File 'lib/txgh-queue/error_handlers/transifex.rb', line 17 def status_for(error) ERROR_CLASSES[error.class] end |