Exception handling for Thumbnail macro.

This commit is contained in:
Colin Kuskie 2010-05-09 15:37:13 -07:00
parent a2feddc3b5
commit 97d5caab17

View file

@ -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;
}
} }