Update Content/Asset for Moose and Exceptions.
This commit is contained in:
parent
b02df9f155
commit
129186c105
1 changed files with 5 additions and 2 deletions
|
|
@ -53,7 +53,7 @@ sub getAsset {
|
|||
my $session = shift;
|
||||
my $assetUrl = shift;
|
||||
my $asset = eval{WebGUI::Asset->newByUrl($session,$assetUrl,$session->form->process("revision"))};
|
||||
if ($@) {
|
||||
if (Exception::Class->caught()) {
|
||||
$session->errorHandler->warn("Couldn't instantiate asset for url: ".$assetUrl." Root cause: ".$@);
|
||||
}
|
||||
return $asset;
|
||||
|
|
@ -179,7 +179,10 @@ sub page {
|
|||
}
|
||||
if ($output eq "") {
|
||||
if ($session->var->isAdminOn) { # they're expecting it to be there, so let's help them add it
|
||||
my $asset = WebGUI::Asset->newByUrl($session, $session->url->getRefererUrl) || WebGUI::Asset->getDefault($session);
|
||||
my $asset = WebGUI::Asset->newByUrl($session, $session->url->getRefererUrl);
|
||||
if (Exception::Class->caught()) {
|
||||
$asset = WebGUI::Asset->getDefault($session);
|
||||
}
|
||||
$output = $asset->addMissing($assetUrl);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue