Skip to content
Permalink
Browse files

Update Content/Asset for Moose and Exceptions.

  • Loading branch information...
perlDreamer committed Feb 4, 2010
1 parent b02df9f commit 129186c105443accf6595b87f9a6068371884746
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/WebGUI/Content/Asset.pm
@@ -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);
}
}

0 comments on commit 129186c

Please sign in to comment.
You can’t perform that action at this time.