Fix the Widget macro.
This commit is contained in:
parent
b3faecae9b
commit
9ef7ee79fa
1 changed files with 5 additions and 2 deletions
|
|
@ -11,6 +11,9 @@ package WebGUI::Macro::Widget;
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use WebGUI::Exception;
|
||||||
|
use WebGUI::Asset;
|
||||||
|
use WebGUI::Storage;
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -55,8 +58,8 @@ sub process {
|
||||||
);
|
);
|
||||||
|
|
||||||
# construct the absolute URL and get the asset ID
|
# construct the absolute URL and get the asset ID
|
||||||
my $asset = WebGUI::Asset->newByUrl($session, $url);
|
my $asset = eval { WebGUI::Asset->newByUrl($session, $url); };
|
||||||
if ( !$asset ) {
|
if ( Exception::Class->caught() ) {
|
||||||
return "Widget: Could not find asset with URL '$url'";
|
return "Widget: Could not find asset with URL '$url'";
|
||||||
}
|
}
|
||||||
my $assetId = $asset->getId;
|
my $assetId = $asset->getId;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue