diff 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
line wrap: on
line diff
--- a/Lib/IMPL/Web/Handler/ErrorHandler.pm	Thu May 15 18:24:28 2014 +0400
+++ b/Lib/IMPL/Web/Handler/ErrorHandler.pm	Mon May 19 18:33:52 2014 +0400
@@ -8,7 +8,8 @@
 		WebException => 'IMPL::Web::Exception',
 		ArgumentException => '-IMPL::InvalidArgumentException',
 		IOException => '-IMPL::IOException',
-		HttpResponse => 'IMPL::Web::HttpResponse'
+		HttpResponse => 'IMPL::Web::HttpResponse',
+		Security => 'IMPL::Security'
 	},
 	base => {
 		'IMPL::Object' => undef,
@@ -45,7 +46,16 @@
 	if (my $err = $@) {
 	    
 		my $vars = {
-			error => $err
+			error => $err,
+			result      => $result,
+	        request     => sub { $action },
+	        app         => $action->application,
+	        location    => $action->context->{resourceLocation},
+	        resource    => $action->context->{resource},
+	        document    => {},
+	        session     => sub { Security->context },
+	        user        => sub { Security->principal },
+	        security    => sub { $action->security }
 		};
 		
 		my $status = "500 Internal Server Error";