X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FView%2FTT.pm;h=f634ca8fedb7604ef9d97af249bcfc738f746bd7;hb=29550a30ca082a8f1f1d0cb1b4a92eb39bc3dd84;hp=5778d8b734b22b0d78c940ef7007400f1fc85c89;hpb=3ed98309a0852fc198f9e4d0e6f70c5510c8282f;p=maypole.git diff --git a/lib/Maypole/View/TT.pm b/lib/Maypole/View/TT.pm index 5778d8b..f634ca8 100644 --- a/lib/Maypole/View/TT.pm +++ b/lib/Maypole/View/TT.pm @@ -51,10 +51,15 @@ sub report_error { my $output; # 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 + { err_type => $type, error => $error, + config => $r->{config}, + request => $r, eval{$self->vars($r)} }, \$output )) { $r->{output} = $output; if ($tt->error) { $r->{output} = "Even the error template @@ -394,19 +399,19 @@ 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(" , ") %]

Application configuration

- - [% FOR thing = config.keys %] - +
[%thing %] [% - config.$thing.list.join(" , ") %]
+ [% FOR field IN config %] + [% END %]
[% field.key %] [% + $field.value.list.join(" , ") %]