DESCRIPTION

The Log::Report::try() catches errors in the block (CODE reference) which is just following the function name. All dispatchers are temporarily disabled by try, and messages which are reported are collected within a temporary dispatcher named try. When the CODE has run, that try dispatcher is returned in $@, and all original dispatchers reinstated.

Then, after the try has finished, the routine which used the "try" should decide what to do with the collected reports. These reports are collected as Log::Report::Exception objects. They can be ignored, or thrown to a higher level try... causing an exit of the program if there is none.

Accessors

The message which was reported by eval, which is used internally to catch problems in the try block.

$obj->exceptions()

Returns all collected Log::Report::Exceptions. The last of them may be a fatal one. The other are non-fatal.

$obj->hide(REASON|REASONS|ARRAY|'ALL'|'NONE')

[1.09] By default, the try will only catch messages which stop the execution of the block (errors etc, internally a 'die'). Other messages are passed to parent try blocks, if none than to the dispatchers.

This option gives the opportunity to block, for instance, trace messages. Those messages are still collected inside the try object, so may get passed-on later via reportAll() if you like.

Be warned: Using this method will reset the whole 'hide' configuration: it's a set not an add.

Other dispatchers translate the message here, and make it leave the program. However, messages in a "try" block are only captured in an intermediate layer: they may never be presented to an end-users. And for sure, we do not know the language yet.