-
Notifications
You must be signed in to change notification settings - Fork 254
fix: log exceptions during source distance calculation #3422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds error logging to the source distance calculation functionality in the In Store Pickup module. When an exception occurs during address-to-coordinates conversion, it will now be logged instead of silently failing.
- Adds logging of
LocalizedException
during source distance calculation - Introduces
LoggerInterface
dependency injection with fallback toObjectManager
/** | ||
* @param GetLatsLngsFromAddressInterface $getLatsLngsFromAddress | ||
* @param GetOrderedDistanceToSources $getOrderedDistanceToSources | ||
* @param AddressInterfaceFactory $addressInterfaceFactory | ||
* @param Pipeline $searchTermPipeline | ||
* @param Logger $logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @SamJUK,
Thanks for the contribution!
Please look into the below review comments. And also check the review comments made by the Copilot.
The failed tests seems flaky to me, will re-run to be double sure.
Thanks
*/ | ||
public function __construct( | ||
GetLatsLngsFromAddressInterface $getLatsLngsFromAddress, | ||
GetOrderedDistanceToSources $getOrderedDistanceToSources, | ||
AddressInterfaceFactory $addressInterfaceFactory, | ||
Pipeline $searchTermPipeline | ||
Pipeline $searchTermPipeline, | ||
LoggerInterface $logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$logger should be null by default
LoggerInterface $logger | |
LoggerInterface $logger=null |
@magento run Functional Tests B2B, Functional Tests CE, Integration Tests, Static Tests, Unit Tests |
Log exceptions encountered during In Stock Pickup source distance calculation instead of silently discarding them.
Fixes: #3420