Exception handling.
This commit is contained in:
parent
4ecc8dce2a
commit
a2feddc3b5
1 changed files with 3 additions and 1 deletions
|
|
@ -44,8 +44,10 @@ This macro takes a templateId to show the links
|
||||||
sub process {
|
sub process {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $templateId = shift || "_aE16Rr1-bXBf8SIaLZjCg";
|
my $templateId = shift || "_aE16Rr1-bXBf8SIaLZjCg";
|
||||||
my $template = WebGUI::Asset::Template->newById($session, $templateId);
|
my $template = eval { WebGUI::Asset::Template->newById($session, $templateId); };
|
||||||
|
if (Exception::Class->caught()) {
|
||||||
return "Could not instanciate template with id [$templateId]" unless $template;
|
return "Could not instanciate template with id [$templateId]" unless $template;
|
||||||
|
}
|
||||||
my $i18n = WebGUI::International->new($session);
|
my $i18n = WebGUI::International->new($session);
|
||||||
my $languages = $i18n->getLanguages();
|
my $languages = $i18n->getLanguages();
|
||||||
my @lang_loop = ();
|
my @lang_loop = ();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue