Mercurial > pub > Impl
comparison Lib/IMPL/Web/Handler/ErrorHandler.pm @ 402:b79081b70a7a
fixed error handler templates env
| author | cin |
|---|---|
| date | Mon, 19 May 2014 18:33:52 +0400 |
| parents | 38cb0b80e88e |
| children |
comparison
equal
deleted
inserted
replaced
| 401:16ff604298c7 | 402:b79081b70a7a |
|---|---|
| 6 use IMPL::declare { | 6 use IMPL::declare { |
| 7 require => { | 7 require => { |
| 8 WebException => 'IMPL::Web::Exception', | 8 WebException => 'IMPL::Web::Exception', |
| 9 ArgumentException => '-IMPL::InvalidArgumentException', | 9 ArgumentException => '-IMPL::InvalidArgumentException', |
| 10 IOException => '-IMPL::IOException', | 10 IOException => '-IMPL::IOException', |
| 11 HttpResponse => 'IMPL::Web::HttpResponse' | 11 HttpResponse => 'IMPL::Web::HttpResponse', |
| 12 Security => 'IMPL::Security' | |
| 12 }, | 13 }, |
| 13 base => { | 14 base => { |
| 14 'IMPL::Object' => undef, | 15 'IMPL::Object' => undef, |
| 15 'IMPL::Object::Autofill' => '@_', | 16 'IMPL::Object::Autofill' => '@_', |
| 16 'IMPL::Object::Serializable' => undef | 17 'IMPL::Object::Serializable' => undef |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 if (my $err = $@) { | 46 if (my $err = $@) { |
| 46 | 47 |
| 47 my $vars = { | 48 my $vars = { |
| 48 error => $err | 49 error => $err, |
| 50 result => $result, | |
| 51 request => sub { $action }, | |
| 52 app => $action->application, | |
| 53 location => $action->context->{resourceLocation}, | |
| 54 resource => $action->context->{resource}, | |
| 55 document => {}, | |
| 56 session => sub { Security->context }, | |
| 57 user => sub { Security->principal }, | |
| 58 security => sub { $action->security } | |
| 49 }; | 59 }; |
| 50 | 60 |
| 51 my $status = "500 Internal Server Error"; | 61 my $status = "500 Internal Server Error"; |
| 52 | 62 |
| 53 if (eval { $err->isa(WebException) }) { | 63 if (eval { $err->isa(WebException) }) { |
