]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Avoid unsightly warning message when evaling broken pagespecs.
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 22 May 2008 17:11:25 +0000 (13:11 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 22 May 2008 17:11:25 +0000 (13:11 -0400)
Also improve error message when a pagespec fails to parse.

IkiWiki.pm
debian/changelog

index 7e64518b313c4c73445974bf45c875739a483464..0440f4020ffb24dbea30be7745bc85d49aac7841 100644 (file)
@@ -1262,6 +1262,7 @@ sub pagespec_translate ($) { #{{{
                $code=0;
        }
 
                $code=0;
        }
 
+       no warnings;
        return eval 'sub { my $page=shift; '.$code.' }';
 } #}}}
 
        return eval 'sub { my $page=shift; '.$code.' }';
 } #}}}
 
@@ -1276,7 +1277,7 @@ sub pagespec_match ($$;@) { #{{{
        }
 
        my $sub=pagespec_translate($spec);
        }
 
        my $sub=pagespec_translate($spec);
-       return IkiWiki::FailReason->new('syntax error') if $@;
+       return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") if $@;
        return $sub->($page, @params);
 } #}}}
 
        return $sub->($page, @params);
 } #}}}
 
index c4919584da5586adee3355b60c8d023f7d49039a..fcb1598f7f3bc434179e6385d2f7f88838751681 100644 (file)
@@ -16,6 +16,8 @@ ikiwiki (2.47) UNRELEASED; urgency=low
   * Perls older than 5.10 need to use the old method of decoding utf-8 in CGI
     values. Neither method will work for all versions of perl, so check
     version number at runtime.
   * Perls older than 5.10 need to use the old method of decoding utf-8 in CGI
     values. Neither method will work for all versions of perl, so check
     version number at runtime.
+  * Avoid unsightly warning message when evaling broken pagespecs.
+  * Improve error message when a pagespec fails to parse.
 
  -- Joey Hess <joeyh@debian.org>  Tue, 13 May 2008 12:30:18 -0400
 
 
  -- Joey Hess <joeyh@debian.org>  Tue, 13 May 2008 12:30:18 -0400