Exception: Serviced::InvalidQuery

Inherits:
Error
  • Object
show all
Defined in:
lib/serviced/errors.rb

Overview

Raised when a Query is called with inputs that fail its validations. Unlike a service (which returns a Failure), a query has no result channel, so invalid input is treated as a programming error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ InvalidQuery

Returns a new instance of InvalidQuery.



22
23
24
25
# File 'lib/serviced/errors.rb', line 22

def initialize(errors)
  @errors = errors
  super("Invalid query input: #{Serviced.error_summary(errors)}")
end

Instance Attribute Details

#errorsActiveModel::Errors (readonly)

Returns the validation errors.

Returns:

  • (ActiveModel::Errors)

    the validation errors



20
21
22
# File 'lib/serviced/errors.rb', line 20

def errors
  @errors
end