diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-11-08 21:03:33 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-11-08 21:03:33 +0000 |
commit | 35ee7e44a62f9126a83c1243b549d47cc5ca7b43 (patch) | |
tree | ba5c6a377f586a8c7114fb4387b2386f06f5e1ee /IkiWiki/Plugin/aggregate.pm | |
parent | dd2ce6e6a064b804902369c74f8a654755ea3de2 (diff) |
* Make sure to check for errors from every eval.
Diffstat (limited to 'IkiWiki/Plugin/aggregate.pm')
-rw-r--r-- | IkiWiki/Plugin/aggregate.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 8c4b1bfe9..2a3f36fce 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -25,6 +25,7 @@ sub import { #{{{ sub getopt () { #{{{ eval q{use Getopt::Long}; + error($@) if $@; Getopt::Long::Configure('pass_through'); GetOptions("aggregate" => \$config{aggregate}); } #}}} @@ -150,7 +151,7 @@ sub loadstate () { #{{{ sub savestate () { #{{{ eval q{use HTML::Entities}; - die $@ if $@; + error($@) if $@; open (OUT, ">$config{wikistatedir}/aggregate" || die "$config{wikistatedir}/aggregate: $!"); foreach my $data (values %feeds, values %guids) { @@ -219,9 +220,9 @@ sub expire () { #{{{ sub aggregate () { #{{{ eval q{use XML::Feed}; - die $@ if $@; + error($@) if $@; eval q{use HTML::Entities}; - die $@ if $@; + error($@) if $@; foreach my $feed (values %feeds) { next unless $config{rebuild} || @@ -316,6 +317,7 @@ sub add_page (@) { #{{{ # to avoid unneccessary rebuilding. The mtime from rss cannot be # trusted; let's use a digest. eval q{use Digest::MD5 'md5_hex'}; + error($@) if $@; require Encode; my $digest=md5_hex(Encode::encode_utf8($params{content})); return unless ! exists $guid->{md5} || $guid->{md5} ne $digest || $config{rebuild}; |