From 55962f477d963b031507016efb29d9a14d0c08e0 Mon Sep 17 00:00:00 2001 From: Scott Walters Date: Wed, 25 Aug 2010 09:30:37 -0400 Subject: [PATCH] Catch graph plugin failures (including lack of existance of) and send the error to the log. --- lib/WebGUI/Asset/Wobject/Poll.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Poll.pm b/lib/WebGUI/Asset/Wobject/Poll.pm index dfa920fc7..18c01fc75 100644 --- a/lib/WebGUI/Asset/Wobject/Poll.pm +++ b/lib/WebGUI/Asset/Wobject/Poll.pm @@ -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);