From: Florian Forster Date: Mon, 14 Sep 2009 13:41:07 +0000 (+0200) Subject: contrib/collection3: Suppress warnings about non-existent classes. X-Git-Tag: collectd-4.7.4~22 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a0e87023585f040b85877b05a21d8453f8f8850c;p=collectd.git contrib/collection3: Suppress warnings about non-existent classes. --- diff --git a/contrib/collection3/lib/Collectd/Graph/TypeLoader.pm b/contrib/collection3/lib/Collectd/Graph/TypeLoader.pm index 69715547..9078110b 100644 --- a/contrib/collection3/lib/Collectd/Graph/TypeLoader.pm +++ b/contrib/collection3/lib/Collectd/Graph/TypeLoader.pm @@ -59,8 +59,9 @@ sub _create_object my $module = shift; my $obj; - local $SIG{__WARN__} = sub { print STDERR "WARNING: " . join (', ', @_) . "\n"; }; - local $SIG{__DIE__} = sub { print STDERR "FATAL: " . join (', ', @_) . "\n"; }; + # Surpress warnings and error messages caused by the eval. + local $SIG{__WARN__} = sub { return (1); print STDERR "WARNING: " . join (', ', @_) . "\n"; }; + local $SIG{__DIE__} = sub { return (1); print STDERR "FATAL: " . join (', ', @_) . "\n"; }; eval <