From 45dc9803fe506f2e308d5c0be48c266290ac8df1 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Mon, 26 Feb 2007 14:49:23 +0000 Subject: [PATCH] Use safe new $conn->check() instead of old private _check(). Notice if catching an exception that's not ZOOM::Exception. --- lib/ZOOM/IRSpy.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ZOOM/IRSpy.pm b/lib/ZOOM/IRSpy.pm index 13b34a6..6997079 100644 --- a/lib/ZOOM/IRSpy.pm +++ b/lib/ZOOM/IRSpy.pm @@ -1,4 +1,4 @@ -# $Id: IRSpy.pm,v 1.68 2007-02-23 16:45:55 mike Exp $ +# $Id: IRSpy.pm,v 1.69 2007-02-26 14:49:23 mike Exp $ package ZOOM::IRSpy; @@ -437,11 +437,13 @@ sub check { die "$conn has no current task for event $ev ($evstr)" if !$task; my $res; - eval { $conn->_check() }; - if ($@) { + eval { $conn->check() }; + if ($@ && ref $@ && $@->isa("ZOOM::Exception")) { my $sub = $task->{cb}->{exception}; die $@ if !defined $sub; $res = &$sub($conn, $task, $task->udata(), $@); + } elsif ($@) { + die "Unexpected non-ZOOM exception: " . ref($@) . " ($@)"; } else { my $sub = $task->{cb}->{$ev}; if (!defined $sub) { -- 1.7.10.4