Exception: Yes::Core::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Yes::Core::Error
- Defined in:
- lib/yes/core/error.rb
Overview
Base class for the gem's errors, carrying optional caller-supplied context.
Direct Known Subclasses
Aggregate::Dsl::CommandDefiner::EventNameResolverError, Aggregate::Dsl::CommandDefiner::UndefinedAttributeError, Aggregate::Dsl::CommandGroupDefiner::UnknownSubCommandError, Aggregate::Dsl::CommandShortcutExpander::InvalidShortcut, AuthenticationError, Command::Invalid, CommandHandling::ConcurrentUpdateError, CommandHandling::GuardEvaluator::TransitionError, CommandHandling::ReadModelRevisionGuard::RevisionAlreadyAppliedError, CommandHandling::ReadModelRevisionGuard::RevisionMismatchError, Commands::Group::Attributes::Invalid, Commands::Stateless::GroupHandler::CommandsError, Commands::Stateless::GroupHandler::CustomHandlerMethodMissingError, Commands::Stateless::GroupHandler::InvalidCommandGroupError, Commands::Stateless::Handler::TransitionError, PayloadStore::Errors::ClientError, PayloadStore::Errors::MissingClient, Utils::CommandUtils::CommandNotFoundError
Instance Attribute Summary collapse
-
#extra ⇒ Object?
readonly
Caller-supplied context, returned exactly as it was given.
Instance Method Summary collapse
-
#initialize(message = nil, extra: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message = nil, extra: nil) ⇒ Error
Returns a new instance of Error.
27 28 29 30 |
# File 'lib/yes/core/error.rb', line 27 def initialize( = nil, extra: nil) super() @extra = extra end |
Instance Attribute Details
#extra ⇒ Object? (readonly)
Caller-supplied context, returned exactly as it was given.
It defaults to nil and is never coerced or validated, so it may be any object the
caller passed. Code that treats it as a Hash must therefore type-check first: a bare
payload.merge!(error.extra) raises TypeError both for the nil default and for any
other non-Hash value. That matters most inside error-reporting hooks, where such a
TypeError tends to be swallowed by the reporter and takes the report down with it.
23 24 25 |
# File 'lib/yes/core/error.rb', line 23 def extra @extra end |