]> git.donarmstrong.com Git - ikiwiki_plugins.git/commitdiff
make more verbose error messages
authorDon Armstrong <don@donarmstrong.com>
Wed, 21 Mar 2012 17:34:47 +0000 (10:34 -0700)
committerDon Armstrong <don@donarmstrong.com>
Wed, 21 Mar 2012 17:34:47 +0000 (10:34 -0700)
sweavealike.pm

index ec6660c09e77e4d26dbb32b3129b8db073aacbc7..661a4316e1806d7b38cd847747236c5043f2056a 100644 (file)
@@ -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}) {