Throw an exception in all wobjects if the main template (used by view)

has been deleted.
This commit is contained in:
Colin Kuskie 2009-06-02 19:34:18 +00:00
parent 62b776d55a
commit 80dfb9ffd0
36 changed files with 350 additions and 97 deletions

View file

@ -207,7 +207,10 @@ sub tryAssetMethod {
$session->asset($asset);
my $methodToTry = "www_".$method;
my $output = eval{$asset->$methodToTry()};
if ($@) {
if (my $e = Exception::Class->caught('WebGUI::Error::ObjectNotFound::Template')) {
$session->errorHandler->error(sprintf "%s templateId: %s assetId: %s", $e->error, $e->assetId, $e->templateId);
}
elsif ($@) {
$session->errorHandler->warn("Couldn't call method ".$method." on asset for url: ".$session->url->getRequestedUrl." Root cause: ".$@);
if ($method ne "view") {
$output = tryAssetMethod($session,$asset,'view');