X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/9a99c4c6e2228954b27e1e93e2b66c12a74850ac..03b956ab4cb2fee8f7b93e725869060bb45fa4ea:/IkiWiki/Plugin/aggregate.pm

diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index 28c445913..fbf88c627 100644
--- a/IkiWiki/Plugin/aggregate.pm
+++ b/IkiWiki/Plugin/aggregate.pm
@@ -553,7 +553,9 @@ sub aggregate (@) {
 			};
 		}
 		if ($@) {
-			$feed->{message}=gettext("feed crashed XML::Feed!")." ($@)";
+			# gettext can clobber $@
+			my $error = $@;
+			$feed->{message}=gettext("feed crashed XML::Feed!")." ($error)";
 			$feed->{error}=1;
 			debug($feed->{message});
 			next;
@@ -675,7 +677,9 @@ sub write_page ($$$$$) {
 		$template=template($feed->{template}, blind_cache => 1);
 	};
 	if ($@) {
-		print STDERR gettext("failed to process template:")." $@";
+		# gettext can clobber $@
+		my $error = $@;
+		print STDERR gettext("failed to process template:")." $error";
 		return;
 	}
 	$template->param(title => $params{title})