From ae88345e045273b82dbbadc3d45260e84510a012 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sat, 22 May 2010 22:27:46 -0700 Subject: [PATCH] Revert the sense of the exception handling, to the right state. --- lib/WebGUI/Shop/TransactionItem.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/WebGUI/Shop/TransactionItem.pm b/lib/WebGUI/Shop/TransactionItem.pm index 60c2a37c8..ffa57cb59 100644 --- a/lib/WebGUI/Shop/TransactionItem.pm +++ b/lib/WebGUI/Shop/TransactionItem.pm @@ -134,11 +134,11 @@ sub getSku { my ($self) = @_; my $asset = eval { WebGUI::Asset->newById($self->transaction->session, $self->get("assetId")); }; if (Exception::Class->caught()) { - $asset->applyOptions($self->get("options")); - return $asset; + WebGUI::Error::ObjectNotFound->throw(error=>'SKU Asset '.$self->get('assetId').' could not be instanciated. Perhaps it no longer exists.', id=>$self->get('assetId')); + return undef; } - WebGUI::Error::ObjectNotFound->throw(error=>'SKU Asset '.$self->get('assetId').' could not be instanciated. Perhaps it no longer exists.', id=>$self->get('assetId')); - return undef; + $asset->applyOptions($self->get("options")); + return $asset; } #-------------------------------------------------------------------