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