Catch graph plugin failures (including lack of existance of) and send the error to the log.

This commit is contained in:
Scott Walters 2010-08-25 09:30:37 -04:00
parent 952a069211
commit 55962f477d

View file

@ -22,6 +22,7 @@ use WebGUI::Asset::Wobject;
use WebGUI::Image::Graph;
use WebGUI::Storage;
use JSON;
use Try::Tiny;
use Moose;
use WebGUI::Definition::Asset;
@ -376,8 +377,15 @@ override processEditForm => sub {
}
if (WebGUI::Image::Graph->getPluginList($self->session)) {
my $graph = WebGUI::Image::Graph->processConfigurationForm($self->session);
$self->setGraphConfig( $graph->getConfiguration );
my $graph;
try {
$graph = WebGUI::Image::Graph->processConfigurationForm($self->session);
} catch {
$self->session->log->error( "Graph plugin not available or not functional: Error: ``$_''" );
};
if( $graph ) {
$self->setGraphConfig( $graph->getConfiguration );
}
}
$self->update($property);