Exception: JSONAPI::Exceptions::InternalServerError
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
Returns the value of attribute exception.
Attributes inherited from Error
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(exception, error_object_overrides = {}) ⇒ InternalServerError
constructor
A new instance of InternalServerError.
Methods inherited from Error
Constructor Details
#initialize(exception, error_object_overrides = {}) ⇒ InternalServerError
Returns a new instance of InternalServerError.
40 41 42 43 |
# File 'lib/jsonapi/exceptions.rb', line 40 def initialize(exception, error_object_overrides = {}) @exception = exception super(error_object_overrides) end |
Instance Attribute Details
#exception ⇒ Object
Returns the value of attribute exception.
38 39 40 |
# File 'lib/jsonapi/exceptions.rb', line 38 def exception @exception end |
Instance Method Details
#errors ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/jsonapi/exceptions.rb', line 45 def errors if JSONAPI.configuration.include_backtraces_in_errors = Hash.new [:exception] = exception. [:backtrace] = exception.backtrace end if JSONAPI.configuration.include_application_backtraces_in_errors ||= Hash.new [:exception] ||= exception. [:application_backtrace] = exception.backtrace.select{|line| line =~ /#{Rails.root}/} end [create_error_object(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 |