Merror is a Perl module that gives you the ability to throw and catch errors in an OOP way. That means if you dont catch errors probably your code will continue running. One big feature of Merror is that it captures a stacktrace when an error occured that you can print out.
SYNOPSIS
use Merror;
function create_error {
my $obj = Merror->new(stackdepth => 16);
#indicate that an error happened
$obj->error(1);
#set an error code
$obj->ec(-1);
#set an error description
$obj->et("This is an error message");
return($obj);
}
my $error_obj = create_error();
#check if an error occured
if($error_obj->error()) {
#print out the errorcode (-1)
print("Errorcode: " . $obj->ec() ."\n");
#print out the error description (This is an error message)
print("Error description: " . $obj->et() . "\n");
#print out the captured stacktrace
$obj->stacktrace();
} else {
print("No error occured\n");
}
Product's homepage
Requirements:
· Perl