From ff4a38aff3e2d22ef34e33cd5df7a16d8ceeb196 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 27 Apr 2017 03:20:59 +0200 Subject: [PATCH] common: early setup of plp error formatting Load at BEGIN to catch compile-time errors. --- common.inc.plp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common.inc.plp b/common.inc.plp index 6b45e50..d7e2b79 100644 --- a/common.inc.plp +++ b/common.inc.plp @@ -20,15 +20,15 @@ sub Alert { say "
$body
\n"; } -$PLP::ERROR = sub { - my ($text, $html) = @_; - Alert("Fatal error: $html."); - warn $text; -}; - BEGIN { require Time::HiRes; our $Time = [Time::HiRes::gettimeofday()]; + + $PLP::ERROR = sub { + my ($text, $html) = @_; + warn $text; + Alert("Fatal error: $html."); + }; } # user request -- 2.30.0