Reworked error handling to propogate errors downward, especially when webgui.debug is set

This commit is contained in:
Scott Walters 2011-07-26 01:26:03 -04:00
parent b815228a1b
commit e945a94c63
12 changed files with 132 additions and 110 deletions

View file

@ -198,12 +198,11 @@ sub callMethod {
}
#Try to call the method
my $output = eval { $self->$method(@{$args}) };
#Croak on error
if($@) {
croak "Unable to run $method on $module: $@";
return undef;
my $output = eval { $self->$method(@{$args}); };
if( $@ ) {
my $e = WebGUI::Error->caught;
$e->{message} = "Unable to run $method on $module: $e->{message}";
$e->rethrow;
}
#Return the output from the method call