From: Don Armstrong Date: Wed, 21 Mar 2012 17:34:47 +0000 (-0700) Subject: make more verbose error messages X-Git-Url: https://git.donarmstrong.com/?p=ikiwiki_plugins.git;a=commitdiff_plain;h=c4c96c7716df32cdb64927f09af4a35b1cab7aeb make more verbose error messages --- diff --git a/sweavealike.pm b/sweavealike.pm index ec6660c..661a431 100644 --- a/sweavealike.pm +++ b/sweavealike.pm @@ -58,7 +58,9 @@ sub preprocess { # we currently don't bother to support anything but outputing the # entire segment of code and its R output - if (not exists $param{code} or not defined $param{code}) { + if (not exists $param{code} + or not defined $param{code} + or not length $param{code}) { error("There wasn't any R code supplied"); } my $code_result; @@ -66,7 +68,7 @@ sub preprocess { $code_result = $pagestate{$param{page}}{$id}{R}->run($param{code}); }; if ($@) { - error($@); + error("code '$param{code}' produced error '$@'"); } my $output = "sweave output\n\n"; if (exists $param{verbatim}) {