Improved robustness and reload protection.
This commit is contained in:
parent
a858e8fb44
commit
913b4710e9
2 changed files with 23 additions and 4 deletions
|
|
@ -21,7 +21,15 @@ sub handler {
|
|||
my $func = 'www_' . ( $form->get('func') || 'view' );
|
||||
my $id = $form->get('id');
|
||||
|
||||
my $object = WebGUI::Pluggable::instanciate( $class, 'new', [ $session, $id ] );
|
||||
my $object = eval { WebGUI::Pluggable::instanciate( $class, 'new', [ $session, $id ] ) };
|
||||
|
||||
if ( $@ || !$object ) {
|
||||
my $ac = WebGUI::AdminConsole->new( $session );
|
||||
my $output = "Unable to instanciate object of class [$class] with id [$id] because: $@";
|
||||
|
||||
return $ac->render( $output, 'Error' );
|
||||
};
|
||||
|
||||
return $object->$func if $object->can( $func );
|
||||
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue