From 54ea1f66e1aff0cb3dd07e947958ee14f85e9eb3 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 6 Apr 2010 18:49:10 -0700 Subject: [PATCH] Catch exceptions when making assets to commit. --- lib/WebGUI/VersionTag.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/WebGUI/VersionTag.pm b/lib/WebGUI/VersionTag.pm index 745022bb9..b836f7de0 100644 --- a/lib/WebGUI/VersionTag.pm +++ b/lib/WebGUI/VersionTag.pm @@ -309,13 +309,13 @@ sub getAssets { $pending = " and assetData.status='pending' "; } my $sth = $self->session->db->read("select asset.assetId,assetData.revisionDate from assetData left join asset on asset.assetId=assetData.assetId where assetData.tagId=? ".$pending." order by ".$sort." ".$direction, [$self->getId]); - while (my ($id,$version) = $sth->array) { - my $asset = WebGUI::Asset->newById($self->session,$id,$version); - unless (defined $asset) { - $self->session->errorHandler->error("Asset $id $version could not be instanciated by version tag ".$self->getId.". Perhaps it is corrupt."); - next; - } - push(@assets, $asset); + ASSETID: while (my ($id,$version) = $sth->array) { + my $asset = eval { WebGUI::Asset->newById($self->session,$id,$version); }; + unless (defined $asset) { + $self->session->errorHandler->error("Asset $id $version could not be instanciated by version tag ".$self->getId.". Perhaps it is corrupt."); + next ASSETID; + } + push(@assets, $asset); } return \@assets; }