Exception: Common::Exceptions::ServiceError
- Defined in:
- lib/common/exceptions/service_error.rb
Direct Known Subclasses
BadGateway, BadRequest, ExternalServerInternalServerError, PayloadTooLarge, ResourceNotFound, ServiceUnavailable, UnprocessableEntity
Instance Attribute Summary collapse
-
#source ⇒ Object
writeonly
Sets the attribute source.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(options = {}) ⇒ ServiceError
constructor
A new instance of ServiceError.
Methods inherited from BaseError
#log_to_sentry?, #message, #sentry_type, #status_code
Constructor Details
#initialize(options = {}) ⇒ ServiceError
Returns a new instance of ServiceError.
10 11 12 13 14 |
# File 'lib/common/exceptions/service_error.rb', line 10 def initialize( = {}) @detail = [:detail] @source = [:source] @errors = [:errors] end |
Instance Attribute Details
#source=(value) ⇒ Object (writeonly)
Sets the attribute source
8 9 10 |
# File 'lib/common/exceptions/service_error.rb', line 8 def source=(value) @source = value end |
Instance Method Details
#errors ⇒ Object
16 17 18 19 20 |
# File 'lib/common/exceptions/service_error.rb', line 16 def errors return @errors if @errors.present? Array(SerializableError.new(i18n_data.merge(detail: @detail, source: @source))) end |