common: restyle fatal runtime errors
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 16 Feb 2015 17:22:45 +0000 (18:22 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 19 Feb 2015 23:21:52 +0000 (00:21 +0100)
Customise PLP errors in distinctive red box instead of default plain table.

base.css
common.inc.plp

index 3db71e83630d2c7f8fb07b30b97e27deb40692b9..7a2d4e7ecc8d1fbf392e112b6fb2cd08b1e77d49 100644 (file)
--- a/base.css
+++ b/base.css
@@ -74,6 +74,17 @@ p.footer {
        margin: 0;
 }
 
+.error {
+       background: #F00;
+       background: rgba(255, 0, 0, .8);
+       color: #FFF;
+       border: 2px solid #000;
+       border-width: 2px 0;
+       padding: 1em;
+       margin: 2ex auto;
+       clear: both;
+}
+
 ul {
        margin: 0;
        padding: 0;
index 963b8a6d1f4a8ef33a7685326c91ed8ae6163862..c6b0c84f69909cbd2432a94328613b51b393fe52 100644 (file)
@@ -10,6 +10,11 @@ use File::stat 'stat';
 use HTTP::Date;
 use Shiar_Sheet::KeySigns qw(%sign);
 
+$PLP::ERROR = sub {
+       my ($text, $html) = @_;
+       print '<p class="error"><strong>Fatal error</strong>: '.$html."</p>\n\n";
+};
+
 our $style;
 our $showkeys = !exists $get{keys} ? undef :
        ($get{keys} ne '0' && ($get{keys} || 'always'));