From a0e87023585f040b85877b05a21d8453f8f8850c Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 14 Sep 2009 15:41:07 +0200 Subject: [PATCH] contrib/collection3: Suppress warnings about non-existent classes. --- contrib/collection3/lib/Collectd/Graph/TypeLoader.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 <