aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrizen <trizen@protonmail.com>2020-06-19 10:44:25 +0300
committerJesús <heckyel@hyperbola.info>2020-06-23 20:00:14 -0500
commit5f677bf269634af885f1fb80f4a6aecab3cefe54 (patch)
tree50db1681cd99da7e73791ddd6b93bb04926def15
parentc5dcae17c4ec6f9b42629102f293bf39ad0b8335 (diff)
downloadfair-viewer-5f677bf269634af885f1fb80f4a6aecab3cefe54.tar.lz
fair-viewer-5f677bf269634af885f1fb80f4a6aecab3cefe54.tar.xz
fair-viewer-5f677bf269634af885f1fb80f4a6aecab3cefe54.zip
Ignore harmless errors.
Signed-off-by: Jesús <heckyel@hyperbola.info>
-rwxr-xr-xbin/gtk-fair-viewer16
1 files changed, 10 insertions, 6 deletions
diff --git a/bin/gtk-fair-viewer b/bin/gtk-fair-viewer
index d6414ad..15951ac 100755
--- a/bin/gtk-fair-viewer
+++ b/bin/gtk-fair-viewer
@@ -380,27 +380,30 @@ while (my ($key, $value) = each %objects) {
local $SIG{__WARN__} = sub {
my $warning = strip_spaces(join('', @_));
+ say STDERR $warning;
+
return if $warning =~ / at \(eval /;
return if $warning =~ /\bunhandled exception in callback:/;
+ return if $warning =~ /, or \} expected while parsing object\/hash/;
$warning = "[" . localtime(time) . "]: " . $warning . "\n";
- print STDERR $warning;
set_text($warnings_textview, $warning, append => 1);
};
# __DIE__ handle
local $SIG{__DIE__} = sub {
- my $error = join('', @_);
my $caller = [caller]->[0];
+ my $error = strip_spaces(join('', @_));
+
+ say STDERR $error;
- # Ignore eval() errors
+ # Ignore harmless errors
return if $error =~ / at \(eval /;
+ return if $error =~ /, or \} expected while parsing object\/hash/;
- # Just print the third-party errors,
- # without displaying them to the user.
+ # Ignore third-party errors
if (not $caller =~ /^(?:main\z|WWW::FairViewer\b)/) {
- print STDERR "@_\n";
return;
}
@@ -416,6 +419,7 @@ local $SIG{__DIE__} = sub {
}
. "\n=>> Previous warnings:\n" . get_text($warnings_textview)
);
+
warn $error;
$errors_window->show;
return 1;