From 297ed0dfa160f41ca8ea850dbff30bad886f0c63 Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Thu, 14 Jan 2021 17:29:31 +0300 Subject: [PATCH] Improve error message formatting based on mode --- web-lib-funcs.pl | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 9bbfd9355..12d1b573e 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -1614,13 +1614,27 @@ elsif ($ENV{'REQUEST_URI'} =~ /json-error=1/) { } else { &header($text{'error'}, ""); - print "
\n"; - print "

",($main::whatfailed ? "$main::whatfailed : " : ""), - @_,"

\n"; + my $hh = $miniserv::page_capture; + print "
\n" if ($hh); + if ($hh) { + print "

",($main::whatfailed ? "$main::whatfailed : " : ""), + @_,"

\n"; + } + else { + print "$text{'error'}: ",($main::whatfailed ? "$main::whatfailed : " : ""), + @_,"

\n"; + } if ($gconfig{'error_stack'}) { # Show call stack - print "

$text{'error_stack'}

\n"; - print "\n"; + print "\n"; + print "
\n"; print " ", " ", "\n"; @@ -1633,7 +1647,7 @@ else { } print "
$text{'error_stack'}
$text{'error_file'}$text{'error_line'}$text{'error_sub'}
\n"; } - print "
\n"; + print "
\n" if ($hh); if ($ENV{'HTTP_REFERER'} && $main::completed_referers_check) { &footer("javascript:history.back()", $text{'error_previous'}); }