Class: TxghQueue::ErrorHandlers::Gitlab
- Inherits:
-
Object
- Object
- TxghQueue::ErrorHandlers::Gitlab
- Defined in:
- lib/txgh-queue/error_handlers/gitlab.rb
Constant Summary collapse
- ERROR_CLASSES =
{ ::Gitlab::Error::BadGateway => Status.retry_without_delay, ::Gitlab::Error::BadRequest => Status.fail, ::Gitlab::Error::Conflict => Status.fail, ::Gitlab::Error::Forbidden => Status.fail, ::Gitlab::Error::InternalServerError => Status.retry_with_delay, ::Gitlab::Error::MethodNotAllowed => Status.fail, ::Gitlab::Error::NotAcceptable => Status.fail, ::Gitlab::Error::NotFound => Status.fail, ::Gitlab::Error::ServiceUnavailable => Status.retry_with_delay, ::Gitlab::Error::TooManyRequests => Status.retry_with_delay, ::Gitlab::Error::Unauthorized => Status.fail, ::Gitlab::Error::Unprocessable => Status.fail }
Class Method Summary collapse
Class Method Details
.can_handle?(error_or_response) ⇒ Boolean
23 24 25 |
# File 'lib/txgh-queue/error_handlers/gitlab.rb', line 23 def can_handle?(error_or_response) error_or_response.is_a?(::Gitlab::Error::Error) end |
.status_for(error) ⇒ Object
27 28 29 |
# File 'lib/txgh-queue/error_handlers/gitlab.rb', line 27 def status_for(error) ERROR_CLASSES.fetch(error.class) { handle_other(error) } end |