git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
word/edit: ignore unicode in json metadata
[sheet.git]
/
font.plp
diff --git
a/font.plp
b/font.plp
index 3a39c2e1e71a0f199e6ae1fd22236aa8e7e369b9..ec612023291030774088846b84e069c3c4020c43 100644
(file)
--- a/
font.plp
+++ b/
font.plp
@@
-15,7
+15,7
@@
Html({
if ($font) {
my ($fontmeta, @cover) = do "data/font/$font.inc.pl";
if ($font) {
my ($fontmeta, @cover) = do "data/font/$font.inc.pl";
- $fontmeta or
die "Unknown font $font\n"
;
+ $fontmeta or
Abort("Unknown font $font", '404 font not found')
;
my $map = eval {
$get{map} or return;
my $map = eval {
$get{map} or return;
@@
-39,7
+39,7
@@
if ($font) {
}
return \@map;
};
}
return \@map;
};
-
die $@
if $@;
+
Abort($@, '404 invalid query')
if $@;
require Unicode::UCD;
require Unicode::UCD;
@@
-52,7
+52,7
@@
if ($font) {
return $_->[0]->[0] for Unicode::UCD::charblock(ucfirst) || (); # block
die "Unknown offset query '$_'\n";
};
return $_->[0]->[0] for Unicode::UCD::charblock(ucfirst) || (); # block
die "Unknown offset query '$_'\n";
};
-
die $@
if $@;
+
Abort($@, '400 invalid offset')
if $@;
say "<h1>Font coverage</h1>";
say "<h2>$_</h2>" for EscapeHTML($fontmeta->{name});
say "<h1>Font coverage</h1>";
say "<h2>$_</h2>" for EscapeHTML($fontmeta->{name});
@@
-218,7
+218,7
@@
my @rows = (
if (my $group = $get{q}) {
my $grouprows = $cover->{$group}
if (my $group = $get{q}) {
my $grouprows = $cover->{$group}
- or
die "Unknown character category $_\n"
;
+ or
Abort("Unknown character category $_", 404)
;
@rows = map { "$group/$_" } sort keys %{$grouprows};
}
@rows = map { "$group/$_" } sort keys %{$grouprows};
}