Exception: Common::Exceptions::InvalidPaginationParams
- Inherits:
-
BaseError
- Object
- StandardError
- BaseError
- Common::Exceptions::InvalidPaginationParams
- Defined in:
- lib/common/exceptions/invalid_pagination_params.rb
Overview
Invalid Pagination Params - if page or per_page params are invalid
Instance Attribute Summary collapse
-
#pagination_params ⇒ Object
readonly
Returns the value of attribute pagination_params.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(pagination_params, options = {}) ⇒ InvalidPaginationParams
constructor
A new instance of InvalidPaginationParams.
Methods inherited from BaseError
#i18n_data, #i18n_field, #i18n_interpolated, #i18n_key, #log_to_sentry?, #message, #sentry_type, #status_code
Constructor Details
#initialize(pagination_params, options = {}) ⇒ InvalidPaginationParams
Returns a new instance of InvalidPaginationParams.
12 13 14 15 |
# File 'lib/common/exceptions/invalid_pagination_params.rb', line 12 def initialize(pagination_params, = {}) @pagination_params = pagination_params @detail = [:detail] || i18n_field(:detail, params: @pagination_params) end |
Instance Attribute Details
#pagination_params ⇒ Object (readonly)
Returns the value of attribute pagination_params.
10 11 12 |
# File 'lib/common/exceptions/invalid_pagination_params.rb', line 10 def pagination_params @pagination_params end |
Instance Method Details
#errors ⇒ Object
17 18 19 |
# File 'lib/common/exceptions/invalid_pagination_params.rb', line 17 def errors Array(SerializableError.new(i18n_data.merge(detail: @detail))) end |