Exception: JSONAPI::Exceptions::InternalServerError
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
Returns the value of attribute exception.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(exception) ⇒ InternalServerError
constructor
A new instance of InternalServerError.
Constructor Details
#initialize(exception) ⇒ InternalServerError
Returns a new instance of InternalServerError.
8 9 10 |
# File 'lib/jsonapi/exceptions.rb', line 8 def initialize(exception) @exception = exception end |
Instance Attribute Details
#exception ⇒ Object
Returns the value of attribute exception.
6 7 8 |
# File 'lib/jsonapi/exceptions.rb', line 6 def exception @exception end |
Instance Method Details
#errors ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/jsonapi/exceptions.rb', line 12 def errors unless Rails.env.production? = Hash.new [:exception] = exception. [:backtrace] = exception.backtrace end [JSONAPI::Error.new(code: JSONAPI::INTERNAL_SERVER_ERROR, status: :internal_server_error, title: I18n.t('jsonapi-resources.exceptions.internal_server_error.title', default: 'Internal Server Error'), detail: I18n.t('jsonapi-resources.exceptions.internal_server_error.detail', default: 'Internal Server Error'), meta: )] end |