X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/fd2b2f386f30cf2ba578da8a8174dd60ae024adc..f5a1550441a9d58652d93deacc333f143a7ecfbd:/IkiWiki/Plugin/template.pm?ds=sidebyside

diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm
index db26bfe31..ccc9cb666 100644
--- a/IkiWiki/Plugin/template.pm
+++ b/IkiWiki/Plugin/template.pm
@@ -41,12 +41,11 @@ sub preprocess (@) {
 			blind_cache => 1);
 	};
 	if ($@) {
-		error gettext("failed to process template:")." $@";
-	}
-	if (! $template) {
-		error sprintf(gettext("%s not found"),
+		# gettext can clobber $@
+		my $error = $@;
+		error sprintf(gettext("failed to process template %s"),
 			htmllink($params{page}, $params{destpage},
-				"/templates/$params{id}"))
+				"/templates/$params{id}"))." $error";
 	}
 
 	$params{basename}=IkiWiki::basename($params{page});