Exception handling for Thumbnail macro.
This commit is contained in:
parent
a2feddc3b5
commit
97d5caab17
1 changed files with 9 additions and 7 deletions
|
|
@ -32,13 +32,15 @@ Image Asset can be found with that URL, then undef will be returned.
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub process {
|
sub process {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $url = shift;
|
my $url = shift;
|
||||||
if (my $image = WebGUI::Asset::File::Image->newByUrl($session,$url)) {
|
my $image = eval { WebGUI::Asset::File::Image->newByUrl($session,$url) };
|
||||||
return $image->getThumbnailUrl;
|
if (Exception::Class->caught()) {
|
||||||
} else {
|
return undef;
|
||||||
return undef;
|
}
|
||||||
}
|
else {
|
||||||
|
return $image->getThumbnailUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue