[Catalyst] Pre-Moose version of Catalyst and all plugins?

Tomas Doran bobtfish at bobtfish.net
Tue Apr 27 07:46:54 GMT 2010

On 26 Apr 2010, at 21:09, Kee Hinckley wrote:

> I'm trying to get some old code running in a hurry. Unfortunately  
> Moose has completely fouled things up.First it broke my use of  
> Error.pm (conflict with "with").

Erm, that'll only break things if you import the Moose helper  
functions into the same package as you try with Error.pm.

You don't have to have a 'use Moose' in your package to use new  
Catalyst - so everything should just work (i.e. I don't see why you're  
crashing into this unless you're changing your application).

If you do want/need this to work, then just do something like this:

package Foo;
use Moose;

# Moose attribute and role declearations here

no Moose;
use Error :try; # Or whatever you're doing

# Put your methods here

> Fortunately I didn't use "with", and could just comment it out. But  
> what I did have was my own Error subclass that was the Catalyst  
> Exception class.
>     $Catalyst::Exception::CATALYST_EXCEPTION_CLASS = 'Error::Throws';
> };
> I have no idea how to even get started on making that work. I made  
> Error a Moose inherited module from Catalyst::Exception (which is  
> the wrong level, but it got rid of:
> Not inlining 'new' for Catalyst::Exception since it is not  
> inheriting the default Moose::Object::new
> If you are certain you don't need to inline your constructor,  
> specify inline_constructor => 0 in your call to Catalyst::Exception- 
> >meta->make_immutable

Erm, this is a warning and shouldn't cause any issues.

> But then that left me with
> Recursive inheritance detected while looking for method 'isa' in  
> package 'Catalyst::Exception' at /usr/local/lib/perl/5.8.8/Class/MOP/ 
> Class.pm line 570.
> If someone has a quick way of telling me how to make my code  
> compatible with Catalyst::Exception that would be great, but I'm  
> worried that I'm going to hit lots of other things like this.

More recent Catalyst releases have changed the way exceptions are  
handled to be more compatible with people overriding things, however  
as you haven't really given us any details (like what your  
'Error::Throws' class actually is / what it contains), or what the  
error actually is if you try and use it unmodified - so I can't really  

> In particular, I'm also using Embperl as a Catalyst interpreter  
> instead of TT,

Erm, you means as the view? Surely perl is the interpreter here....

> Any suggestion on a solution that isn't going to take me days?

Yes, give us some actual details about the issue you have :)

FWIW, most people's applications run entirely unmodified with Catalyst  
5.80, and I'd very much guess that exception handling is likely to be  
the only major issue you have...

The above proves that you're changing your app before actually just  
trying to get it running - which is causing you more problems than  
it's solving!


More information about the Catalyst mailing list