Exception: JSONAPI::Exceptions::BadRequest
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(exception, error_object_overrides = {}) ⇒ BadRequest
constructor
A new instance of BadRequest.
Methods inherited from Error
Constructor Details
#initialize(exception, error_object_overrides = {}) ⇒ BadRequest
Returns a new instance of BadRequest.
145 146 147 148 |
# File 'lib/jsonapi/exceptions.rb', line 145 def initialize(exception, error_object_overrides = {}) @exception = exception super(error_object_overrides) end |
Instance Method Details
#errors ⇒ Object
150 151 152 153 154 155 156 157 |
# File 'lib/jsonapi/exceptions.rb', line 150 def errors [create_error_object(code: JSONAPI::BAD_REQUEST, status: :bad_request, title: I18n.translate('jsonapi-resources.exceptions.bad_request.title', default: 'Bad Request'), detail: I18n.translate('jsonapi-resources.exceptions.bad_request.detail', default: @exception))] end |