On Wed, 15 Sep 2004 12:47:20 +0200, Sebastian Riedel wrote
> Simon Flack:
>
> >I've read the section on error handling in the request cookbook, but I'd like
> >to do something a bit more advanced with exception objects, and I'd like to
> >let my model classes try and handle exceptions too.
> >
> >It's possible to achieve some of this by overriding &process in your model
> >class, but it's not easy or straightforward to handle exceptions at the
> >application level. Here's a contrived example of the sort of thing I'd like to
> >be able to do:
> >
[snip]
> We discussed this a bit on IRC and we all agreed that an
> error_handler would be overkill, why not just use eval() or Error.pm
> in your methods?
>
> sebastian
Because the controller should be able to handle any exceptions that the model
doesn't. It's not very easy with the current Maypole implimentation. I'm doing
it already but it's a hack and it sucks. And I don't see what Error.pm has to
do with it apart from it's an alternative to Exception::Class.
Can you explain how it's "overkill" to add some basic support for exceptions?
You don't have to use it, you can carry on using "return $r->error($foo)".
It's just a little bit of extra flexibility to make it easier for people to
impliment their own exception handling. Isn't that what Maypole is all about?
Is there an online archive of IRC discussions somewhere?
--simonflk
_______________________________________________
maypole-dev mailing list
maypole-dev at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole-dev
This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT