Data::Object::Try

Data-Object Try/Catch Class

use Data::Object::Try;

my $try = Data::Object::Try->new;

$try->call(fun (@args) {
  # try something

  return something
});

$try->catch($type, fun ($caught) {
  # caught an exception

  return $something;
});

$try->default(fun ($caught) {
  # catch the uncaught

  return $something;
});

$try->finally(fun (@args) {
  # always run after try/catch
});

my $result = $try->result(@args);

Data::Object::Library

invocant(Object, opt, ro) arguments(ArrayRef, opt, ro) on_try(CodeRef, opt, rw) on_catch(ArrayRef[CodeRef], opt, rw) on_default(CodeRef, opt, rw) on_finally(CodeRef, opt, rw)

This package provides an object-oriented interface for performing complex try/catch operations.

6 POD Errors

The following errors were encountered while parsing the POD:

Around line 8:

Unknown directive: =name

Around line 12:

Unknown directive: =abstract

Around line 16:

Unknown directive: =synopsis

Around line 46:

Unknown directive: =library

Around line 50:

Unknown directive: =attributes

Around line 59:

Unknown directive: =description