Skip to content

Commit

Permalink
Ignore the harmless warning "[JSON] , or } expected while parsing obj…
Browse files Browse the repository at this point in the history
…ect/hash".
  • Loading branch information
trizen committed Jun 19, 2020
1 parent 9398610 commit b9bfb84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bin/gtk2-youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,13 @@ 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);
};
Expand Down
4 changes: 3 additions & 1 deletion bin/gtk3-youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,13 @@ 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);
};
Expand Down
2 changes: 1 addition & 1 deletion bin/youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ EOD

my $dumped_config = q{our $CONFIG = } . Data::Dump::pp(\%CONFIG) . "\n";

if ($home_dir eq $ENV{HOME}) {
if (defined($ENV{HOME}) and $home_dir eq $ENV{HOME}) {
$dumped_config =~ s/\Q$home_dir\E/\$ENV{HOME}/g;
}

Expand Down

0 comments on commit b9bfb84

Please sign in to comment.