Exception: EVSS::DisabilityCompensationForm::ServiceException
- Inherits:
-
ServiceException
- Object
- StandardError
- Common::Exceptions::BaseError
- ServiceException
- EVSS::DisabilityCompensationForm::ServiceException
- Includes:
- SentryLogging
- Defined in:
- lib/evss/disability_compensation_form/service_exception.rb
Overview
Custom exception that maps EVSS 526 errors to error details defined in config/locales/exceptions.en.yml
Constant Summary collapse
- ERROR_MAP =
{ serviceError: 'evss.external_service_unavailable', ServiceException: 'evss.external_service_unavailable', notEligible: 'evss.disability_compensation_form.not_eligible', InProcess: 'evss.disability_compensation_form.form_in_process', disabled: 'evss.disability_compensation_form.disabled', marshalError: 'evss.disability_compensation_form.marshall_error', startBatchJobError: 'evss.disability_compensation_form.start_batch_job_error', Size: 'common.exceptions.validation_errors', Pattern: 'common.exceptions.validation_errors', NotNull: 'common.exceptions.validation_errors', header: 'common.exceptions.validation_errors', ActiveDuty13BirthDate: 'common.exceptions.validation_errors', DisabilityDuplicate: 'common.exceptions.validation_errors', TreatmentPastActiveDutyDate: 'common.exceptions.validation_errors', AttachmentType: 'common.exceptions.validation_errors', directDeposit: 'common.exceptions.validation_errors', disabilities: 'common.exceptions.validation_errors', militaryPayments: 'common.exceptions.validation_errors', serviceInformation: 'common.exceptions.validation_errors', treatments: 'common.exceptions.validation_errors', VeteranRecordWsClientException: 'evss.disability_compensation_form.ws_client_exception', veteran: 'common.exceptions.validation_errors', MaxEPCode: 'evss.disability_compensation_form.max_ep_code', PIFInUse: 'evss.disability_compensation_form.pif_in_use', default: 'evss.unmapped_service_exception' }.freeze
Instance Attribute Summary
Attributes inherited from ServiceException
Instance Method Summary collapse
- #errors ⇒ Object
-
#retryable? ⇒ Boolean
Retry if any upstream external service unavailability exceptions (unless it is caused by an invalid EP code) and any PIF-in-use exceptions are encountered.
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger
Methods inherited from ServiceException
Methods inherited from Common::Exceptions::BaseError
#log_to_sentry?, #message, #sentry_type, #status_code
Constructor Details
This class inherits a constructor from EVSS::ServiceException
Instance Method Details
#errors ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/evss/disability_compensation_form/service_exception.rb', line 49 def errors Array( Common::Exceptions::SerializableError.new( i18n_data.merge(source: 'EVSS::DisabilityCompensationForm::Service', meta: { messages: @messages }) ) ) end |
#retryable? ⇒ Boolean
Retry if any upstream external service unavailability exceptions (unless it is caused by an invalid EP code) and any PIF-in-use exceptions are encountered.
43 44 45 46 47 |
# File 'lib/evss/disability_compensation_form/service_exception.rb', line 43 def retryable? (@key == 'evss.external_service_unavailable' && ) || (@key == 'evss.disability_compensation_form.pif_in_use') || (@key == 'evss.disability_compensation_form.ws_client_exception') end |