CAF::Exception¶
NAME¶
CAF::Exception - provides basic methods for failure and exception handling
Private methods¶
- _get_noaction
Return NoAction setting:
- Return 0 is
keeps_stateis trueAny other value ofkeeps_stateis ignored. (In particular, you cannot usekeeps_stateto enable NoAction).
- Return value of
noActionmethod (when defined)CAF::Object::NoActionotherwiseSupports an optional
msgthat is prefixed to reporter.
- _reset_exception_fail
Reset previous fail attribute and/or exception.
msgis a suffix when reporting the oldfailattribute and/or exception error (with debug level 1).
ECis aLC::Exception::Contextinstance that is checked for an existing error, which is set to ignore if it exists.Always returns SUCCESS.
- _function_catch
Execute function reference
funcrefwith arrayref$argsand hashref$opts.Method resets any existing fail attribute and error from
LC::Exception::ContextinstanceEC.When an exception thrown is thrown, it is catched and reset. No error is reported and undef is returned in this case and the fail attribute is set with the exception error text.
- _safe_eval
Run function reference
funcrefwith arrayrefargsrefand hashrefoptsref.Return and set fail attribute with
failmsg($@is added when set) on die or in case of an error (undefreturned byfuncref). In case of success, reportmsg(stringified result is added unlesssensitiveattribute is set) at verbose level.Note that
_safe_evaldoesn’t work with functions that don’t return a defined value when they succeed.Resets previous fail attribute and or exceptions (via the
LC::Exception::ContextinstanceEC).