git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
common: common Alert function to format error messages
[sheet.git]
/
common.inc.plp
diff --git
a/common.inc.plp
b/common.inc.plp
index 81f91b5bc8dbd285777083dabdd232fdd17bcc4d..e4cc5f99f5635a4920d007ddb5433878c13c991c 100644
(file)
--- a/
common.inc.plp
+++ b/
common.inc.plp
@@
-10,9
+10,15
@@
use File::stat 'stat';
use HTTP::Date;
use Encode qw( decode_utf8 );
use HTTP::Date;
use Encode qw( decode_utf8 );
+sub Alert {
+ my ($title, $debug) = @_;
+ $title .= ": <em>$debug</em>" if $Dev and defined $debug;
+ say "<p class=error>$title</p>\n";
+}
+
$PLP::ERROR = sub {
my ($text, $html) = @_;
$PLP::ERROR = sub {
my ($text, $html) = @_;
-
print '<p class="error"><strong>Fatal error</strong>: '.$html."</p>\n\n"
;
+
Alert("<strong>Fatal error</strong>: $html.")
;
warn $text;
};
warn $text;
};