X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/3b395d58206174e283f62ac5ca3a382c9d375a02..b97ebd969b2e520d3e65509c0f892edacae70520:/common.inc.plp diff --git a/common.inc.plp b/common.inc.plp index 81f91b5..e4cc5f9 100644 --- a/common.inc.plp +++ b/common.inc.plp @@ -10,9 +10,15 @@ use File::stat 'stat'; use HTTP::Date; use Encode qw( decode_utf8 ); +sub Alert { + my ($title, $debug) = @_; + $title .= ": $debug" if $Dev and defined $debug; + say "

$title

\n"; +} + $PLP::ERROR = sub { my ($text, $html) = @_; - print '

Fatal error: '.$html."

\n\n"; + Alert("Fatal error: $html."); warn $text; };