Update Account/Shop for exceptions.

This commit is contained in:
Colin Kuskie 2010-01-28 13:20:01 -08:00
parent 1b87d4877c
commit 34846c45a6

View file

@ -267,11 +267,15 @@ sub www_viewSales {
. q{ group by assetId order by quantity desc },
[ $vendor->getId ]
);
while (my $row = $sth->hashRef) {
ROW: while (my $row = $sth->hashRef) {
my $data = $row;
# Add asset properties to tmpl_vars.
my $asset = WebGUI::Asset->newById( $session, $row->{ assetId } );
my $asset = eval { WebGUI::Asset->newById( $session, $row->{ assetId } ); };
if (Exception::Class->caught()) {
$session->log->error('Unable to instanciate assetId '.$row->{ assetId }.": $@");
next ROW;
}
$row = { %{ $row }, %{ $asset->get } } if $asset;
push @products, $row;