X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FView%2FTT.pm;h=78aad9325199f07101d71afbffa116540d2f9cac;hb=3cf2fea8686cea17e128789566a0cd55f2046833;hp=5778d8b734b22b0d78c940ef7007400f1fc85c89;hpb=3ed98309a0852fc198f9e4d0e6f70c5510c8282f;p=maypole.git diff --git a/lib/Maypole/View/TT.pm b/lib/Maypole/View/TT.pm index 5778d8b..78aad93 100644 --- a/lib/Maypole/View/TT.pm +++ b/lib/Maypole/View/TT.pm @@ -49,13 +49,22 @@ sub template { sub report_error { my ($self, $r, $error, $type) = @_; my $output; + + warn "self : $self, r : $r, error : $error, type : $type\n"; + # Need to be very careful here. my $tt = Template->new; + unless (ref $r->{config}) { + warn "no config for this request\n"; + $error .= '
There was a problem finding configuration for this request'; + $r->{config} ||= {}; + } if ($tt->process(\$error_template, - { err_type => $type, error => $error, - config => { %{$r->{config}}}, - request => $r, # We have that at least - eval{$self->vars($r)} }, \$output )) { + { err_type => $type, error => $error, + config => $r->{config}, + request => $r, + paths => $self->paths($r), + eval{$self->vars($r)} }, \$output )) { $r->{output} = $output; if ($tt->error) { $r->{output} = "Even the error template errored - ".$tt->error.""; } @@ -394,23 +403,27 @@ the path "[% request.path %]". The error text returned was:

Request details

- - [% FOR thing = ["model_class", "table", "template", "path", +
+ [% FOR attribute = ["model_class", "table", "template", "path", "content_type", "document_encoding", "action", "args", "objects"] %] - + [% END %]
[%thing %] [% - request.$thing.list.join(" , ") %]
[% attribute %] [% + request.$attribute.list.join(" , ") %]
+

Website / Template Paths

+ + + +
Base URI [% request.config.uri_base %]
Paths [% paths %]
+

Application configuration

- - [% FOR thing = config.keys %] - - [% END %] +
[%thing %] [% - config.$thing.list.join(" , ") %]
+ + + +
Model [% request.config.model %]
View [% request.config.view %]
Classes [% request.config.classes.list.join(" , ") %]
Tables [% request.config.display_tables.list.join(" , ") %]
- -