[Catalyst] Deep recursion error message !

Jose Nyimi josenyimi at skynet.be
Sat Apr 9 00:25:43 CEST 2005


Hello,
 
package Magic;
 
use strict;
use Catalyst qw/-Debug/;
 
our $VERSION = '0.01';
 
Magic->config(
    name => 'Magic',
    root => 'C:\Magic/root',
);
 
Magic->setup;
 
sub default : Private {
    my ( $self, $c ) = @_;
            $c->forward( '/trick/default' ); ### Here is the problem
!!!!
}
 
##
 
package Magic::C::Trick;
 
use strict;
use base 'Catalyst::Base';
 
sub default : Private {
    my ( $self, $c ) = @_;
    $c->res->output('Congratulations, Magic::C::Trick is on Catalyst!');
}
 
sub trick : Private {
    my ( $self, $c ) = @_;
            $c->res->output(__PACKAGE__ . ' : trick');
}
 
##
 
C:\Magic\script>perl test.pl /
[Fri Apr  8 23:37:10 2005] [catalyst] [debug] Debug messages enabled
[Fri Apr  8 23:37:11 2005] [catalyst] [debug] Loaded engine
"Catalyst::Engine::T
est"
[Fri Apr  8 23:37:11 2005] [catalyst] [debug] Loaded components
.=----------------------------------------------------------------------
------=.
 
| Magic::C::Trick
|
'=----------------------------------------------------------------------
------='
 
 
[Fri Apr  8 23:37:11 2005] [catalyst] [debug] Loaded private actions
.=-----------------------------+------------------------------+---------
------=.
 
| Private                      | Class                        | Code
|
 
|=-----------------------------+------------------------------+---------
------=|
 
| /default                     | Magic                        |
CODE(0x1e98580 |
 
| /trick/trick                 | Magic::C::Trick              |
CODE(0x1eb3728 |
 
| /trick/default               | Magic::C::Trick              |
CODE(0x1eae7d4 |
 
'=-----------------------------+------------------------------+---------
------='
 
 
[Fri Apr  8 23:37:11 2005] [catalyst] [info] Magic powered by Catalyst
5.00
[Fri Apr  8 23:37:11 2005] [catalyst] [debug]
**********************************
 
[Fri Apr  8 23:37:11 2005] [catalyst] [debug] * Request 1 (1.000/s)
[2008]
[Fri Apr  8 23:37:11 2005] [catalyst] [debug]
**********************************
 
[Fri Apr  8 23:37:11 2005] [catalyst] [debug] "GET" request for "" from
localhos
t(127.0.0.1)
Deep recursion on subroutine "Catalyst::Engine::benchmark" at
C:/Perl/site/lib/C
atalyst/Engine.pm line 199.
Deep recursion on subroutine "Catalyst::Engine::execute" at
C:/Perl/site/lib/Cat
alyst/Engine.pm line 442.
Deep recursion on subroutine "Magic::default" at
C:/Perl/site/lib/Catalyst/Engin
e.pm line 67.
Deep recursion on subroutine "Catalyst::Engine::forward" at
C:/Magic/script/../l
ib/Magic.pm line 17.
 
Then the program never stop :-)
Even worse if I try the same via the browser: the all PC gets blocked, I
need the “TaskManager” to kill and get thinks back.
 
Is it possible to avoid this recursion loop and just exit with an
helpfull error message ?
 
Note thet the error disappears if I change the “sub default” in “package
Magic::C::Trick” from Private to Local.
 
Thanks,
José.
 
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20050409/3bbe9e92/attachment.htm


More information about the Catalyst mailing list