Skip to content

Commit

Permalink
chore(cart): lower log level for errors during decorating (#509)
Browse files Browse the repository at this point in the history
* chore(cart): lower log level to debug on errors during cart decorating

* chore: fix lint
  • Loading branch information
carstendietrich authored Dec 5, 2023
1 parent 7e018c4 commit 1f79296
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cart/domain/decorator/cartDecorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ func (df *DecoratedCartFactory) CreateDecorateCartItems(ctx context.Context, ite
func (df *DecoratedCartFactory) decorateCartItem(ctx context.Context, cartItem cartDomain.Item) DecoratedCartItem {
decoratedItem := DecoratedCartItem{Item: cartItem, logger: df.logger}

product, e := df.productService.Get(ctx, cartItem.MarketplaceCode)
if e != nil {
df.logger.WithContext(ctx).Error("cart.decorator - no product for item", e)
product, err := df.productService.Get(ctx, cartItem.MarketplaceCode)
if err != nil {
df.logger.WithContext(ctx).Debug("cart.decorator - no product for item: ", err)

if product == nil {
// To avoid errors if consumers want to access the product data
product = domain.SimpleProduct{
Expand Down

0 comments on commit 1f79296

Please sign in to comment.