From: Mischa POSLAWSKY Date: Thu, 30 Mar 2017 14:24:48 +0000 (+0200) Subject: browser,chars: error formatting for invalid input X-Git-Tag: v1.10~271 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/70b958bcdf1c8fa7105090135818d7219cec8fa0 browser,chars: error formatting for invalid input --- diff --git a/browser.plp b/browser.plp index bdde90e..0d4d4e7 100644 --- a/browser.plp +++ b/browser.plp @@ -96,11 +96,13 @@ given ($get{usage} // 'wm') { # none } when (!m{ \A [a-z]\w+ (?:/\d[\d-]*\d)? \z }x) { - printf "

Invalid browser usage data request: %s", - 'identifier must be alphanumeric name or 0'; + Alert([ + 'Invalid browser usage data request', + 'Identifier must be alphanumeric name or 0.', + ]); } $canihas = do "data/browser/usage-$_.inc.pl" or do { - printf "

Browser usage data not found: %s", $@ || $!; + Alert('Browser usage data not found', $@ || $!); break; }; $usage = $_; diff --git a/chars.plp b/chars.plp index a175f8d..f9af5df 100644 --- a/chars.plp +++ b/chars.plp @@ -53,7 +53,7 @@ my $query = eval { say "

$title

"; if (!$query) { - say "

Unicode group not specified: $@

"; + Alert('Unicode group not specified', $@); exit; };