From 33e3013acbef27ba49fa091389ed8bf4096fa860 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 16 Feb 2015 18:22:45 +0100 Subject: [PATCH] common: restyle fatal runtime errors Customise PLP errors in distinctive red box instead of default plain table. --- base.css | 11 +++++++++++ common.inc.plp | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/base.css b/base.css index 3db71e8..7a2d4e7 100644 --- 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; diff --git a/common.inc.plp b/common.inc.plp index 963b8a6..c6b0c84 100644 --- a/common.inc.plp +++ b/common.inc.plp @@ -10,6 +10,11 @@ use File::stat 'stat'; use HTTP::Date; use Shiar_Sheet::KeySigns qw(%sign); +$PLP::ERROR = sub { + my ($text, $html) = @_; + print '

Fatal error: '.$html."

\n\n"; +}; + our $style; our $showkeys = !exists $get{keys} ? undef : ($get{keys} ne '0' && ($get{keys} || 'always')); -- 2.30.0