Exception: Common::Exceptions::InternalServerError
- Defined in:
- lib/common/exceptions/internal_server_error.rb
Overview
Internal Server Error - all exceptions not readily accounted fall into this tier
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(exception) ⇒ InternalServerError
constructor
A new instance of InternalServerError.
Methods inherited from BaseError
#i18n_data, #i18n_field, #i18n_interpolated, #i18n_key, #log_to_sentry?, #message, #sentry_type, #status_code
Constructor Details
#initialize(exception) ⇒ InternalServerError
Returns a new instance of InternalServerError.
12 13 14 15 16 |
# File 'lib/common/exceptions/internal_server_error.rb', line 12 def initialize(exception) raise ArgumentError, 'an exception must be provided' unless exception.is_a?(Exception) @exception = exception end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
10 11 12 |
# File 'lib/common/exceptions/internal_server_error.rb', line 10 def exception @exception end |
Instance Method Details
#errors ⇒ Object
18 19 20 21 |
# File 'lib/common/exceptions/internal_server_error.rb', line 18 def errors = { exception: exception., backtrace: exception.backtrace } unless ::Rails.env.production? Array(SerializableError.new(i18n_data.merge(meta:))) end |