From 25af57948cb65571d7941edcd57f8f90f81f0f10 Mon Sep 17 00:00:00 2001 From: Aline Abler Date: Thu, 7 Dec 2023 10:56:11 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Sebastian Widmer --- controllers/saleorder/saleorder_storage.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/saleorder/saleorder_storage.go b/controllers/saleorder/saleorder_storage.go index 806fbe1e..0fe179cc 100644 --- a/controllers/saleorder/saleorder_storage.go +++ b/controllers/saleorder/saleorder_storage.go @@ -104,7 +104,7 @@ func (s *Odoo16SaleOrderStorage) GetSaleOrderName(org organizationv1.Organizatio ) id, err := strconv.Atoi(org.Status.SaleOrderID) if err != nil { - return "", err + return "", fmt.Errorf("error parsing saleOrderID %q from organization status: %w", org.Status.SaleOrderID, err) } soRecords := []odooclient.SaleOrder{} err = s.client.Read(odooclient.SaleOrderModel, []int64{int64(id)}, fetchOrderFieldOpts, &soRecords) @@ -113,7 +113,7 @@ func (s *Odoo16SaleOrderStorage) GetSaleOrderName(org organizationv1.Organizatio } if len(soRecords) <= 0 { - return "", fmt.Errorf("no results when fetching sale order by ID") + return "", fmt.Errorf("no results when fetching sale orders with ID %q", id) } return soRecords[0].Name.Get(), nil