Skip to content

Commit 2bc3f0e

Browse files
committed
MAGETWO-90327: Dedicated debug logging files for Payment and Shipping activity
1 parent 8f89daa commit 2bc3f0e

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

app/code/Magento/Fedex/Test/Unit/Model/CarrierTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ public function scopeConfigGetValue(string $path)
234234
'carriers/fedex/allowed_methods' => 'ServiceType',
235235
'carriers/fedex/debug' => 1,
236236
];
237+
237238
return isset($pathMap[$path]) ? $pathMap[$path] : null;
238239
}
239240

app/code/Magento/Ups/Model/Carrier.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ protected function _getCgiQuotes()
485485

486486
$debugData['result'] = $responseBody;
487487
$this->_setCachedQuotes($params, $responseBody);
488-
} catch (\Exception $e) {
488+
} catch (\Throwable $e) {
489489
$debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()];
490490
$responseBody = '';
491491
}
@@ -745,7 +745,7 @@ protected function _getXmlQuotes()
745745
$xmlResponse = $client->getBody();
746746
$debugData['result'] = $xmlResponse;
747747
$this->_setCachedQuotes($xmlRequest, $xmlResponse);
748-
} catch (\Exception $e) {
748+
} catch (\Throwable $e) {
749749
$debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()];
750750
$xmlResponse = '';
751751
}
@@ -1033,7 +1033,7 @@ protected function _getXmlTracking($trackings)
10331033
$client->post($url, $this->_xmlAccessRequest . $xmlRequest);
10341034
$xmlResponse = $client->getBody();
10351035
$debugData['result'] = $xmlResponse;
1036-
} catch (\Exception $e) {
1036+
} catch (\Throwable $e) {
10371037
$debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()];
10381038
$xmlResponse = '';
10391039
}
@@ -1445,14 +1445,14 @@ protected function _sendShipmentAcceptRequest(Element $shipmentConfirmResponse)
14451445
$xmlResponse = $client->getBody();
14461446
$debugData['result'] = $xmlResponse;
14471447
$this->_setCachedQuotes($xmlRequest, $xmlResponse);
1448-
} catch (\Exception $e) {
1448+
} catch (\Throwable $e) {
14491449
$debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()];
14501450
$xmlResponse = '';
14511451
}
14521452

14531453
try {
14541454
$response = $this->_xmlElFactory->create(['data' => $xmlResponse]);
1455-
} catch (\Exception $e) {
1455+
} catch (\Throwable $e) {
14561456
$debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()];
14571457
}
14581458

@@ -1493,7 +1493,6 @@ public function getShipAcceptUrl()
14931493
*
14941494
* @param \Magento\Framework\DataObject $request
14951495
* @return \Magento\Framework\DataObject
1496-
* @throws \Exception
14971496
*/
14981497
protected function _doShipmentRequest(\Magento\Framework\DataObject $request)
14991498
{
@@ -1513,14 +1512,14 @@ protected function _doShipmentRequest(\Magento\Framework\DataObject $request)
15131512
$xmlResponse = $client->getBody();
15141513
$debugData['result'] = $xmlResponse;
15151514
$this->_setCachedQuotes($xmlRequest, $xmlResponse);
1516-
} catch (\Exception $e) {
1515+
} catch (\Throwable $e) {
15171516
$debugData['result'] = ['code' => $e->getCode(), 'error' => $e->getMessage()];
15181517
}
15191518
}
15201519

15211520
try {
15221521
$response = $this->_xmlElFactory->create(['data' => $xmlResponse]);
1523-
} catch (\Exception $e) {
1522+
} catch (\Throwable $e) {
15241523
$debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()];
15251524
$result->setErrors($e->getMessage());
15261525
}

app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ protected function setUp()
160160
/**
161161
* Callback function, emulates getValue function.
162162
*
163-
* @param $path
163+
* @param string $path
164164
* @return null|string
165165
*/
166-
public function scopeConfigGetValue($path)
166+
public function scopeConfigGetValue(string $path)
167167
{
168168
$pathMap = [
169169
'carriers/ups/free_method' => 'free_method',
@@ -384,6 +384,8 @@ public function countryDataProvider()
384384

385385
/**
386386
* Checks a case when UPS processes request to create shipment.
387+
*
388+
* @return void
387389
*/
388390
public function testRequestToShipment()
389391
{

0 commit comments

Comments
 (0)