[Catalyst-dev] A suggestion(or question) about exception handling.

John Napiorkowski jjn1056 at yahoo.com
Tue Jul 22 02:16:42 BST 2008




--- On Mon, 7/21/08, Chae Lee <yuand2 at gmail.com> wrote:

> From: Chae Lee <yuand2 at gmail.com>
> Subject: Re: [Catalyst-dev] A suggestion(or question) about exception handling.
> To: "Development of the elegant MVC web framework" <catalyst-dev at lists.scsys.co.uk>
> Date: Monday, July 21, 2008, 7:32 PM
> On Mon, Jul 21, 2008 at 5:46 PM, Matt S Trout
> <dbix-class at trout.me.uk>
> wrote:
> 
> > On Sat, Jul 19, 2008 at 10:16:55PM -0400, Chae Lee
> wrote:
> > > hi all,
> > >
> > > in my Catalyst application, I'm using my own
> exception handling based on
> > > "Error.pm", and used to ask myself what
> if Catalyst provided the
> > facility.
> > >
> > > I know there are several ways in error(or
> exception) handling in Perl,
> > but,
> > > anyway my favorite is "try/catch."
> > >
> > > today I saw Catalyst::Exception. It wasn't
> what I expected.
> > >
> > > so... is there already any extension based on
> Error.pm in Catalyst OR any
> > > plan??
> >
> > Extension for what?
> >
> > There's nothing to stop you using Error.pm in the
> Catalyst app - I don't
> > really see what Catalyst needs to do about it?
> >
> 
> I thought my email was sucked up. Good job Matt ^^
> 
> Well... using Error.pm in Catalyst doesn't depend on
> Catalyst, but it can
> save some extra work if
> provided.

I wonder if there are not two issues here.  If you just want Error.pm for your Controllers, you can make one that contains it.  You'll just have to export Error's namespace into your base controller and then all your custom controllers would inherit from that instead of Catalyst::Controller.  However if what you are saying is that Catalyst should have a more fine grained error hierarchy (something like Java Spring comes to mind when I think of a web development framework with something like this) that's a totally different question.  Since Catalyst is somewhat minimal, I don't really see the value of that.  It doesn't really play into the way most Perl programmer's go about things.  Although a CatalystX package to provide default methods for 404, 5xx style http errors might be welcomed.  Like "CatalystX::Rescue" or similar?  I know Apache also provides this.

JohnN
_______________________________________________
> Catalyst-dev mailing list
> Catalyst-dev at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


      



More information about the Catalyst-dev mailing list