Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Widmer <[email protected]>
  • Loading branch information
HappyTetrahedron and bastjan authored Dec 7, 2023
1 parent 8026bac commit 25af579
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/saleorder/saleorder_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 25af579

Please sign in to comment.