Skip to content

Commit

Permalink
feat(aduptech): changed log messages in convertCurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
danygielow committed Jan 29, 2025
1 parent 09f4c2c commit 842d4e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions adapters/aduptech/aduptech.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ func (a *adapter) convertCurrency(value float64, cur string, reqInfo *adapters.E
convertedValue, err = reqInfo.ConvertCurrency(value, cur, "USD")

if err != nil {
return 0, err
return 0, fmt.Errorf("Currency conversion rate not found from '%s' to '%s'. Error converting from '%s' to 'USD': %w", cur, a.extraInfo.TargetCurrency, cur, err)
}

convertedValue, err = reqInfo.ConvertCurrency(convertedValue, "USD", a.extraInfo.TargetCurrency)

if err != nil {
return 0, err
return 0, fmt.Errorf("Currency conversion rate not found from '%s' to '%s'. Error converting from 'USD' to '%s': %w", cur, a.extraInfo.TargetCurrency, a.extraInfo.TargetCurrency, err)
}
}
return convertedValue, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"expectedBidResponses": [],
"expectedMakeRequestsErrors": [
{
"value": "Currency conversion rate not found: 'USD' => 'EUR'",
"value": "Currency conversion rate not found from 'AUD' to 'EUR'. Error converting from 'USD' to 'EUR': Currency conversion rate not found: 'USD' => 'EUR'",
"comparison": "literal"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"expectedBidResponses": [],
"expectedMakeRequestsErrors": [
{
"value": "Currency conversion rate not found: 'AUD' => 'USD'",
"value": "Currency conversion rate not found from 'AUD' to 'EUR'. Error converting from 'AUD' to 'USD': Currency conversion rate not found: 'AUD' => 'USD'",
"comparison": "literal"
}
]
Expand Down

0 comments on commit 842d4e7

Please sign in to comment.