Exception: Common::Exceptions::BaseError
- Inherits:
-
StandardError
- Object
- StandardError
- Common::Exceptions::BaseError
show all
- Defined in:
- lib/common/exceptions/base_error.rb
Overview
Base error class all others inherit from
Direct Known Subclasses
AmbiguousRequest, BackendServiceException, DetailedSchemaErrors, FailedDependency, FilterNotAllowed, Forbidden, GatewayTimeout, InternalServerError, InvalidField, InvalidFieldValue, InvalidFiltersSyntax, InvalidPaginationParams, InvalidResource, InvalidSortCriteria, MessageAuthenticityError, NoQueryParamsAllowed, NotASafeHostError, OpenIdServiceError, ParameterMissing, ParametersMissing, RecordNotFound, RoutingError, SchemaValidationErrors, ServiceError, ServiceOutage, TokenValidationError, TooManyRequests, Unauthorized, ValidationErrors, EVSS::GiBillStatus::ExternalServiceUnavailable, EVSS::GiBillStatus::OutsideWorkingHours, EVSS::ServiceException, Lighthouse::LettersGenerator::ServiceError, Rx::RxGatewayTimeout, VIC::IDCardAttributeError
Instance Method Summary
collapse
Instance Method Details
#errors ⇒ Object
7
8
9
|
# File 'lib/common/exceptions/base_error.rb', line 7
def errors
raise NotImplementedError, 'Subclass of Error must implement errors method'
end
|
#log_to_sentry? ⇒ Boolean
28
29
30
|
# File 'lib/common/exceptions/base_error.rb', line 28
def log_to_sentry?
sentry_type != 'none'
end
|
#message ⇒ Object
18
19
20
|
# File 'lib/common/exceptions/base_error.rb', line 18
def message
i18n_data[:title]
end
|
#sentry_type ⇒ Object
This determines how the exception should get logged to Sentry in adddition to available types from Sentry: ‘warn’, ‘info’, ‘error’ there is ‘none’ to not log to Sentry at all
24
25
26
|
# File 'lib/common/exceptions/base_error.rb', line 24
def sentry_type
i18n_data[:sentry_type].presence || 'error'
end
|
#status_code ⇒ Object
11
12
13
14
15
16
|
# File 'lib/common/exceptions/base_error.rb', line 11
def status_code
return if errors&.first.blank?
return errors.first[:status]&.to_i if errors.first.is_a?(Hash)
errors&.first&.status&.to_i
end
|