Skip to content

Commit

Permalink
Merge pull request #317 from PrestaShopCorp/fix-logger-no-response
Browse files Browse the repository at this point in the history
fix: log without response when response does not exist
  • Loading branch information
emmanuelgautier authored Apr 3, 2023
2 parents 243beda + 35041ae commit a5ae19d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ps_accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,11 @@ public function hookActionObjectShopDeleteBefore($params)

try {
$response = $accountsApi->deleteUserShop($params['object']->id);

if (!$response || true !== $response['status']) {
if (!$response) {
$this->getLogger()->debug(
'Error trying to DELETE shop : No $response object'
);
} elseif (true !== $response['status']) {
$this->getLogger()->debug(
'Error trying to DELETE shop : ' . $response['httpCode'] .
' ' . print_r($response['body']['message'], true)
Expand Down

0 comments on commit a5ae19d

Please sign in to comment.