Did you submit this to POE's RT?

http://rt.cpan.org/Public/Bug/Report.html?Queue=POE

Cheers,
David

On 7/17/07, Phil Whelan <[EMAIL PROTECTED]> wrote:

Hi,

Where should I send my patch to POE::Kernel? The propagation of
exceptions did not seem to be working as documented.

Thanks,
Phil

--- /usr/local/share/perl/5.8.8/POE/Kernel.pm   2007-07-17
16:54:57.000000000 -0700
+++ /usr/local/share/perl/5.8.8/POE/Kernel.pm   2007-07-17
16:56:42.000000000 -0700
@@ -901,7 +901,9 @@
       my $touched_index = 0;
       while ($touched_index < @touched_sessions) {
         my $next_target = $touched_sessions[$touched_index];
-        push @touched_sessions,
$self->_data_ses_get_children($next_target);
+        push @touched_sessions,
+            grep { ref($_) ne 'POE::Kernel' }
+            $self->_data_ses_get_parent($next_target);
         $touched_index++;
       }


Test
-----

#!/usr/bin/perl

use strict;
use warnings;

use Test::More tests => 2;
use POE;

POE::Session->create(
    inline_states => {
        _start => sub {
            $poe_kernel->sig(DIE => 'parent_exception');
            POE::Session->create(
                inline_states => {
                    _start => sub {
                        $poe_kernel->sig(DIE => 'child_exception');
                        $poe_kernel->post($_[SESSION], "throw_exception");
                    },
                    throw_exception => sub { die "goodbye sweet world" },
                    child_exception => sub { pass("child got exception")
},
                },
            )
        },
        parent_exception => sub {
            pass("parent got exception");
            $poe_kernel->sig_handled();
        },
        _stop => sub { exit },
    },
);

POE::Kernel->run();
exit;




--

David Davis
Software Engineer

Reply via email to