From: Mike Taylor Date: Mon, 26 Feb 2007 14:49:23 +0000 (+0000) Subject: Use safe new $conn->check() instead of old private _check(). X-Git-Tag: CPAN-v1.02~592 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=3485e1231149de913ce56cc73c0467ee703ca656;p=irspy-moved-to-github.git Use safe new $conn->check() instead of old private _check(). Notice if catching an exception that's not ZOOM::Exception. --- 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) {