Hi All,
Yesterday I released the third development version of Catalyst 'Runner' on the
heels of the second release just a few days ago. This was needed because the
second release had some debugging code left in it accidentally and was causing
installation and testing fails for people that wanted to try out the new
features. My apologies.
Included with this bug fix is some additional documentation around using plack
middleware and one new feature that allows one to use (or to mount a psgi
application that uses) exception objects as described in the plack middleware
https://metacpan.org/pod/Plack::Middleware::HTTPExceptions
The idea is this middleware catches exception object that match an interface
and uses them to provide content or behavior like redirection. Ultimately I
think all the custom error handling could move to middleware, including the
default production and debug error pages. This would get them out of the main
code and let you customize the behavior without needing nasty plugins. For
this first iteration
Later on I plan to see what tools like might buy us. I've always been a big
fan of the lisp conditional approach but for now you can actually do like
use HTTP::Throwable:: Factory;
sub from_catalyst :Local {
my ($self, $c) = @_;
HTTP::Throwable::Factory->throw(MovedPermanently => { location => '/new' });
}
and it works as expected.
So the hope here is to make it easier to customize and control default for the
various types of error pages you use.
As we add more middleware we are starting to approach the point where an array
is no longer the best way to manage our included middlware. Anyone out there
have experience using Javascript Connect or the Rails MiddlewareStack can
comment and help design a Sane API?
jnap
_______________________________________________
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/