Subject: | old exception handling patches and test from my inbox |
Date: | Fri, 24 Mar 2006 01:25:20 -0500 |
To: | bug-poe [...] rt.cpan.org |
From: | Rocco Caputo <rcaputo [...] pobox.com> |
This is a reminder to review the testcase and patch for relevance.
They may be pointless now.
Message body is not shown because sender requested not to inline it.
--- POE/Kernel.pm.orig 2004-05-12 17:26:02.000000000 +0100
+++ POE/Kernel.pm 2004-05-12 17:45:01.000000000 +0100
@@ -850,14 +850,18 @@
$before = time();
}
my $return;
- if (wantarray) {
- $return =
- [ $session->_invoke_state($source_session, $event, $etc,
$file, $line) ];
- }
- else {
- $return =
- $session->_invoke_state($source_session, $event, $etc, $file,
$line);
- }
+ my $user_error = undef;
+ eval {
+ if (wantarray) {
+ $return =
+ [ $session->_invoke_state($source_session, $event, $etc,
$file, $line) ];
+ }
+ else {
+ $return =
+ $session->_invoke_state($source_session, $event, $etc,
$file, $line);
+ }
+ };
+ $user_error = $@;
if (TRACE_STATISTICS) {
my $after = time();
@@ -939,6 +943,7 @@
# Recover the event being processed.
$kr_active_event = $hold_active_event;
+ die($user_error) if ($user_error);
# Return what the handler did. This is used for call().
return @$return if wantarray;
return $return;
--
Rocco Caputo - rcaputo@pobox.com
Message body is not shown because sender requested not to inline it.