add human-readable error when unknown pagespec function is called
[ikiwiki.git] / IkiWiki.pm
index ca483a111693291adab7efbc720b2f8bdeda94c3..4d8415ffd6c67ef47d1e812e65596fd4550f6d0c 100644 (file)
@@ -1729,7 +1729,7 @@ sub pagespec_translate ($) {
                                $code.="IkiWiki::PageSpec::match_$1(\$page, ".safequote($2).", \@_)";
                        }
                        else {
-                               $code.=' 0';
+                               $code.="IkiWiki::FailReason->new(".safequote(qq{unknown function in pagespec "$word"}).")";
                        }
                }
                else {
@@ -1738,7 +1738,7 @@ sub pagespec_translate ($) {
        }
 
        if (! length $code) {
-               $code=0;
+               $code="IkiWiki::FailReason->new('empty pagespec')";
        }
 
        no warnings;