Revert the sense of the exception handling, to the right state.

This commit is contained in:
Colin Kuskie 2010-05-22 22:27:46 -07:00
parent 5759620eb4
commit ae88345e04

View file

@ -134,11 +134,11 @@ sub getSku {
my ($self) = @_; my ($self) = @_;
my $asset = eval { WebGUI::Asset->newById($self->transaction->session, $self->get("assetId")); }; my $asset = eval { WebGUI::Asset->newById($self->transaction->session, $self->get("assetId")); };
if (Exception::Class->caught()) { if (Exception::Class->caught()) {
$asset->applyOptions($self->get("options")); WebGUI::Error::ObjectNotFound->throw(error=>'SKU Asset '.$self->get('assetId').' could not be instanciated. Perhaps it no longer exists.', id=>$self->get('assetId'));
return $asset; 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')); $asset->applyOptions($self->get("options"));
return undef; return $asset;
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------