From db46cad8879087b9b5da6e1dda2018c78fbde288 Mon Sep 17 00:00:00 2001 From: David Delikat Date: Mon, 12 Dec 2011 16:46:07 -0600 Subject: [PATCH] fixed bug in error message in sub process: check caught exception for reference or scalar before processing --- lib/WebGUI/Asset/Template.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm index c2b4b5587..e46532e95 100644 --- a/lib/WebGUI/Asset/Template.pm +++ b/lib/WebGUI/Asset/Template.pm @@ -722,9 +722,10 @@ sub process { my $output; eval { $output = $parser->process($template, $vars); }; if (my $e = Exception::Class->caught) { - $session->log->error(sprintf "Error processing template: %s, %s, %s", $self->getUrl, $self->getId, $e->error); + my $message = ref $e ? $e->error : $e; + $session->log->error(sprintf "Error processing template: %s, %s, %s", $self->getUrl, $self->getId, $message); my $i18n = WebGUI::International->new($session, 'Asset_Template'); - $output = sprintf $i18n->get('template error').$e->error, $self->getUrl, $self->getId; + $output = sprintf $i18n->get('template error').$message, $self->getUrl, $self->getId; } return $output; }