Skip Menu |

This queue is for tickets about the Catalyst-Runtime CPAN distribution.

Report information
The Basics
Id: 78057
Status: open
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: Nobody in particular
Requestors: DROLSKY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Debug error page causes exception
Caught exception in engine "Can't call method "finalize_headers" on an undefined value at /home/autarch/projects/Catalyst- Runtime/lib//Catalyst/Response.pm line 60, <DATA> line 998." On IRC, hobbs found the issue, which is the call to "$c->res- Show quoted text
>_clear_context" in the Catalyst::Engine code.
He also proposed a simple fix: diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 77bd1c5..df8e247 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1626,8 +1626,12 @@ that will be dumped on the error page in debug mode. sub dump_these { my $c = shift; + my $res = { %{ $c->res } }; # Shallow copy + # Don't show response context in the dump + $res->_clear_context; + [ Request => $c->req ], - [ Response => $c->res ], + [ Response => $res ], [ Stash => $c->stash ], [ Config => $c->config ]; } diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 4781e45..daf53d1 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -180,9 +180,6 @@ sub finalize_error { $title = $name = "$name on Catalyst $Catalyst::VERSION"; $name = "<h1>$name</h1>"; - # Don't show context in the dump - $c->res->_clear_context; - # Don't show body parser in the dump $c->req->_clear_body; ------------------------- Longer term, I'd really like to see Catalyst switch to Data::Dump::Streamer, which would give us control over how things are serialized. This has the big benefit of letting app developers define a DDS_freeze method for their classes to control app object display.
On Tue Jun 26 12:41:35 2012, DROLSKY wrote: Show quoted text
> Caught exception in engine "Can't call method "finalize_headers" on an > undefined value at /home/autarch/projects/Catalyst- > Runtime/lib//Catalyst/Response.pm line 60, <DATA> line 998." > > On IRC, hobbs found the issue, which is the call to "$c->res-
> >_clear_context" in the Catalyst::Engine code.
> > He also proposed a simple fix:
This fix doesn't actually work, but I think the idea is sane: make dump_these responsible for filtering the output instead of finalize_error, and make it filter *copies* rather than fiddling around with objects that could be important. More to come.