Exception: Gitlab::Error::ResponseError
- Defined in:
- lib/gitlab/error.rb
Overview
Custom error class for rescuing from HTTP response errors.
Direct Known Subclasses
BadGateway, BadRequest, Conflict, Forbidden, InternalServerError, MethodNotAllowed, NotFound, ServiceUnavailable, Unauthorized, Unprocessable
Constant Summary collapse
- POSSIBLE_MESSAGE_KEYS =
%i(message error_description error)
Instance Method Summary collapse
-
#initialize(response) ⇒ ResponseError
constructor
A new instance of ResponseError.
-
#response_message ⇒ String
Body content returned in the HTTP response.
-
#response_status ⇒ Integer
Status code returned in the HTTP response.
Constructor Details
#initialize(response) ⇒ ResponseError
Returns a new instance of ResponseError.
16 17 18 19 |
# File 'lib/gitlab/error.rb', line 16 def initialize(response) @response = response super() end |
Instance Method Details
#response_message ⇒ String
Body content returned in the HTTP response
31 32 33 |
# File 'lib/gitlab/error.rb', line 31 def @response.parsed_response. end |
#response_status ⇒ Integer
Status code returned in the HTTP response.
24 25 26 |
# File 'lib/gitlab/error.rb', line 24 def response_status @response.code end |