Exception: Lurch::Errors::JSONApiError
- Inherits:
-
StandardError
- Object
- StandardError
- Lurch::Errors::JSONApiError
- Defined in:
- lib/lurch/errors/json_api_error.rb
Direct Known Subclasses
BadRequest, Conflict, Forbidden, NotFound, ServerError, Unauthorized, UnprocessableEntity
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(document) ⇒ JSONApiError
constructor
A new instance of JSONApiError.
- #message ⇒ Object
Constructor Details
#initialize(document) ⇒ JSONApiError
Returns a new instance of JSONApiError.
4 5 6 |
# File 'lib/lurch/errors/json_api_error.rb', line 4 def initialize(document) @document = document end |
Instance Method Details
#errors ⇒ Object
13 14 15 16 |
# File 'lib/lurch/errors/json_api_error.rb', line 13 def errors return [] unless errors_document? @document["errors"].map { |error| Lurch::Error.new(error) } end |
#message ⇒ Object
8 9 10 11 |
# File 'lib/lurch/errors/json_api_error.rb', line 8 def return @document unless errors_document? @document["errors"].map { |error| (error) }.join(", ") end |