From 9c3a3b1b7926f1047d90179e9f88dcdab3e3581f Mon Sep 17 00:00:00 2001 From: Scott Walters Date: Wed, 18 Aug 2010 15:29:14 -0400 Subject: [PATCH] It's better to die than to return in failure. --- lib/WebGUI/Image/Graph.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/WebGUI/Image/Graph.pm b/lib/WebGUI/Image/Graph.pm index 0bd611fb5..3e598b90f 100644 --- a/lib/WebGUI/Image/Graph.pm +++ b/lib/WebGUI/Image/Graph.pm @@ -602,14 +602,18 @@ sub processConfigurationForm { my $class = shift; my $session = shift; - return undef unless ($class->getPluginList($session)); + if (! $class->getPluginList($session)) { + WebGUI::Error->throw(error => "No graphing plugins listed in config") + } my $namespace = "WebGUI::Image::".$session->form->process('graphingPlugin'); $namespace =~ s/_/::/g; - return undef unless (isIn($namespace, @{$class->getPluginList($session)})); + if (! isIn($namespace, @{$class->getPluginList($session)})) { + WebGUI::Error->throw(error => "Graphing plugin not available") + } -my $graph = $class->load($session, $namespace); + my $graph = $class->load($session, $namespace); $graph->setConfiguration($session->form->paramsHashRef);