NAME
Class::AbstractLogic::Result - Result for a Logic Object Call
DESCRIPTION
An object of this class is returned when a method on a logic object got called. You should not create this object directly.
METHODS
new(%args)
Constructor,
capture($code, @arguments)
Calls the $code
reference with the @arguments
and builds a Result object. If this is used as an object- instead of a class-method, it just resets the objects value appropriately.
throw_exception($key, $error)
Throws an exception. Since this class knows how to handle exceptions, it also is the one that knows how to throw them. No matter if class or object method, this simply throws an Exception with the given values.
is_ok() / is_failed()
Return the boolean value telling if this result caught an exception, or succeeded.
result() / value()
Returns the captured result value. Will be undef
if an exception was thrown.
key() / error() / exception()
These hold the corresponding values or undef
if the request succeeded. The exception
is the original exception object, error
the message and key
the specified error key.
SEE ALSO
AUTHOR
Robert 'phaylon' Sedlacek <phaylon@dunkelheit.at>
LICENSE AND COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.