List Info

Thread: How do I run finalize_error only if $c->debug is false?




How do I run finalize_error only if $c->debug is false?
user name
2007-08-21 20:49:37
I would like the regular error page with info when I'm
running under
debug.  I have a finalize_error method set up similar to the
one from
the mailing list archives, but I don't understand yet the
magic of
return vs. next() and what will happen if I want to skip my
version
under debug.


Barry Hoggard

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

Re: How do I run finalize_error only if $c->debug is false?
country flaguser name
United Kingdom
2007-08-22 02:16:33
On Tue, Aug 21, 2007 at 09:49:37PM -0400, Barry Hoggard
wrote:
> I would like the regular error page with info when I'm
running under
> debug.  I have a finalize_error method set up similar
to the one from
> the mailing list archives, but I don't understand yet
the magic of
> return vs. next() and what will happen if I want to
skip my version
> under debug.

my $c = shift;

if ($c->debug) {
  return $c->NEXT::finalize_error(_);
}

<rest of your custom finalize_error here>

-- 
      Matt S Trout       Need help with your Catalyst or
DBIx::Class project?
   Technical Director    Want a managed development or
deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at)
shadowcatsystems.co.uk for a quote
http://chainsawblues.vo
x.com/                    http://www.shadowcat.co.u
k/ 

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )