fixed bug in error message in sub process: check caught exception for reference or scalar before processing
This commit is contained in:
parent
fd98df41d3
commit
db46cad887
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue