Subject: | Constants for exception handling |
It would be nice if Try::Lite some constants like this:
use constant {
IGNORE => sub { return; },
WARNING => sub { warn($@); },
RETHROW => sub { die($@); },
};
This would allow the following sugary code to work:
try {
some('code');
}
NetworkException => IGNORE,
FileException => WARNING,
PermissionsException => RETHROW,
;