Skip to content

Commit

Permalink
Merge pull request #93 from logeecom/master
Browse files Browse the repository at this point in the history
Release version 3.4.9
  • Loading branch information
david-romero authored Dec 26, 2024
2 parents 91e51f0 + f1581b8 commit 25c3c5a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [3.4.9](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.4.8...v3.4.9) - 2024-12-09
### Changed
- Add special handling for 429 - Too many retries exception

## [3.4.8](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.4.7...v3.4.8) - 2024-12-09
### Changed
- Add unsupported country Japan
Expand Down
16 changes: 16 additions & 0 deletions src/BusinessLogic/Order/OrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
namespace Packlink\BusinessLogic\Order;

use Exception;
use Logeecom\Infrastructure\Http\Exceptions\HttpAuthenticationException;
use Logeecom\Infrastructure\Http\Exceptions\HttpBaseException;
use Logeecom\Infrastructure\Http\Exceptions\HttpCommunicationException;
use Logeecom\Infrastructure\Http\Exceptions\HttpRequestException;
use Logeecom\Infrastructure\Logger\Logger;
use Logeecom\Infrastructure\ServiceRegister;
use Packlink\BusinessLogic\BaseService;
Expand Down Expand Up @@ -103,6 +106,10 @@ public function setReference($orderId, $shipmentReference)
* @param Shipment $shipment
* @param string $customsId
*
* @throws HttpAuthenticationException
* @throws HttpBaseException
* @throws HttpCommunicationException
* @throws HttpRequestException
* @throws OrderShipmentDetailsNotFound
*/
public function updateShipmentData(Shipment $shipment, $customsId = '')
Expand Down Expand Up @@ -183,6 +190,11 @@ public function updateShippingStatus(Shipment $shipment, $status)
* Updates tracking info from API for order with given shipment reference.
*
* @param Shipment $shipment Shipment DTO for given reference number.
*
* @throws HttpBaseException
* @throws HttpAuthenticationException
* @throws HttpCommunicationException
* @throws HttpRequestException
*/
public function updateTrackingInfo(Shipment $shipment)
{
Expand Down Expand Up @@ -210,6 +222,10 @@ public function updateTrackingInfo(Shipment $shipment)
$trackingHistory
);
} catch (HttpBaseException $e) {
if ($e->getCode() === 429) {
throw $e;
}

Logger::logWarning($e->getMessage(), 'Core', array(
'referenceId' => $shipment->reference,
'trace' => $e->getTraceAsString(),
Expand Down

0 comments on commit 25c3c5a

Please sign in to comment.