Skip to content

Commit

Permalink
Item13897: A bit more on error/warnings handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
vrurg committed May 2, 2016
1 parent a75b8b8 commit cb4a63d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/lib/Foswiki.pm
Expand Up @@ -290,7 +290,7 @@ BEGIN {
# FOSWIKI_ASSERTS. If ASSERTs are off, this is assumed to be a
# production environment, and no stack traces or paths are
# output to the browser.
$SIG{'__WARN__'} = sub { die @_ };
#$SIG{'__WARN__'} = sub { die @_ };
$Error::Debug = 1; # verbose stack traces, please
}
else {
Expand Down
11 changes: 6 additions & 5 deletions core/lib/Foswiki/Plugin.pm
Expand Up @@ -156,11 +156,12 @@ sub BUILD {
local $SIG{__WARN__};
eval "use $p";
if ($@) {
my $errMessage = ref($@) ? $@->stringify : $@;
push(
@{ $this->errors },
"$p could not be loaded. Errors were:\n$@\n----"
);
my $errMessage =
"$p could not be loaded. Errors were:\n"
. Foswiki::Exception::errorStr($@)
. "\n----";
push( @{ $this->errors }, $errMessage );
Foswiki::Func::writeDebug($errMessage);
$this->disabled(1);
$this->reason('no_load_plugin');
}
Expand Down

0 comments on commit cb4a63d

Please sign in to comment.