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

2010-04-28 Thread Matt S Trout
On Mon, Apr 26, 2010 at 04:09:48PM -0400, Kee Hinckley wrote:
> I'm trying to get some old code running in a hurry. Unfortunately Moose has 
> completely fouled things up.

No it hasn't. Please throw away your preconceptions and report the actual
problem.

> First it broke my use of Error.pm (conflict with "with"). 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.

You mean you added 'use Moose' somewhere and thereby found you had a 'with'
sub imported. That happens when you add import lines.

You can ask Moose to not import with, you can ask Error to not import with,
or you can ask Moose to import with under a different name.

But I don't even understand why you added 'use Moose' to your own classes at
all since that's in no way required to use Catalyst 5.80 - we spent a lot of
time making sure old code Just Worked for every application we could get at.
 
> BEGIN {
> $Catalyst::Exception::CATALYST_EXCEPTION_CLASS = 'Error::Throws';
> };

is the BEGIN block -before- the 'use Catalyst' line?
 
> 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:

I have no idea how it doesn't work yet because you didn't tell us what didn't
work.

Maybe you could elaborate a little?

> 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

Which is a warning, not an error - though it's a little annoying. Let's fix
everything else and get to that one last?

> 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.

I can't find Error::Throws on CPAN.

Is it a private package?

If so, please show us what it contains - we're not really going to be able
to debug it otherwise.

> 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. In particular, I'm also using Embperl as 
> a Catalyst interpreter instead of TT, so I may hit Moose again there. It 
> might be easier for me to just take a step back in time and get old versoins:

I have no idea what you mean by "hit Moose" and I have no idea how Moose
and Embperl are remotely related. Could you elaborate please?

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

Not until you tell us what the actual problems are, no, sorry.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


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

2010-04-27 Thread Tomas Doran


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.


BEGIN {
$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  
speculate..


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!


Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


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

2010-04-26 Thread Kee Hinckley
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"). 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.

BEGIN {
$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

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. In particular, I'm also using Embperl as a 
Catalyst interpreter instead of TT, so I may hit Moose again there. It might be 
easier for me to just take a step back in time and get old versoins:

use Catalyst (qw{
-Debug 
-Home=root/src
ConfigLoader
Static::Simple

StackTrace

Authentication
Authentication::Store::DBIC
Authentication::Credential::Password

Authorization::Roles
Authorization::ACL

Session
Session::Store::DBIC
Session::State::Cookie
Cache

Prototype
Params::Nested
SubRequest

ThrowForward});

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


Kee Hinckley
Owner, Somewhere LLC.   Somewhere: http://www.somewhere.com/TechnoSocial: 
http://xrl.us/bh35i

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/