class Sequent::Core::CommandNotValid
Raised when BaseCommand.valid? returns false
Attributes
Public Class Methods
Source
# File lib/sequent/core/command_service.rb, line 118 def initialize(command) @command = command msg = @command.respond_to?(:aggregate_id) ? " #{@command.aggregate_id}" : '' super("Invalid command #{@command.class}#{msg}, errors: #{@command.validation_errors}") end
Calls superclass method
Public Instance Methods
Source
# File lib/sequent/core/command_service.rb, line 124 def errors(prefix = nil) I18n.with_locale(Sequent.configuration.error_locale_resolver.call) do @command.validation_errors(prefix) end end
Source
# File lib/sequent/core/command_service.rb, line 130 def errors_with_command_prefix errors(@command.class.to_s.underscore) end