From 2fad20dcd0fee65ae46f7aeb7cc08ea606b6a038 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 7 May 2010 18:02:17 -0700 Subject: [PATCH] Exception handling when trying to get assets for their content. --- lib/WebGUI/FilePump/Bundle.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/FilePump/Bundle.pm b/lib/WebGUI/FilePump/Bundle.pm index 8df18aff9..65f5afaf0 100644 --- a/lib/WebGUI/FilePump/Bundle.pm +++ b/lib/WebGUI/FilePump/Bundle.pm @@ -3,6 +3,7 @@ package WebGUI::FilePump::Bundle; use base qw/WebGUI::Crud WebGUI::JSONCollateral/; use strict; use WebGUI::International; +use WebGUI::Exception; use WebGUI::Utility; use URI; use Path::Class; @@ -508,8 +509,8 @@ sub fetchAsset { my $url = $uri->opaque; $url =~ s{^/+}{}; - my $asset = WebGUI::Asset->newByUrl($self->session, $url); - return {} unless $asset; + my $asset = eval {WebGUI::Asset->newByUrl($self->session, $url);}; + return {} if Exception::Class->caught(); ##Check for a snippet, or snippet subclass? my $guts = { lastModified => $asset->get('lastModified'),