From: Mischa POSLAWSKY Date: Sat, 14 May 2022 14:35:50 +0000 (+0200) Subject: common: treat exception references as alert parameters X-Git-Tag: v1.14~98 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/88048e2c00e3e9a9c172e788722354017cd401ec common: treat exception references as alert parameters Pass on debug messages from (possibly trapped) perl/plp errors. --- diff --git a/common.inc.plp b/common.inc.plp index 2483504..71c5c13 100644 --- a/common.inc.plp +++ b/common.inc.plp @@ -196,13 +196,20 @@ EOT BEGIN { $PLP::ERROR = sub { - my ($text, $html) = @_; - warn $text; + my ($message, $html) = @_; + if (ref $message) { + warn join ': ', @{$message}; + $html = shift @{$message}; + } + else { + warn $message; + $message = []; + } unless ($PLP::sentheaders) { Html({nocache => 1}); say '

Page unavailable

'; } - Alert("Fatal error: $html."); + Alert("Fatal error: $html.", @{$message}); }; } diff --git a/latin.plp b/latin.plp index f9453e6..a86f2ca 100644 --- a/latin.plp +++ b/latin.plp @@ -47,16 +47,15 @@ or 'mercan) letters A–Z. Also see related alphabets and font comparison.

-
- <: use List::Util qw( pairs ); my @table = do 'writing-latn.inc.pl'; -if ($! or $@) { - Alert("Table data not found", $@ || $!); +if ($! or $@ or !@table) { + die ["Table data not found", $@ || $!]; } else { + say '
'; say '