Skip to content

Commit

Permalink
Merge pull request #51 from aligent/fix/type_error
Browse files Browse the repository at this point in the history
Fix/type error
  • Loading branch information
aligent-lturner authored Nov 20, 2024
2 parents fa0323e + d6e518a commit 01bae5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/export/Model/Api/DataIntegrationClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
use Magento\Framework\Filesystem\Io\File;
use Psr\Log\LoggerInterface;

use function PHPUnit\Framework\stringStartsWith;

class DataIntegrationClient
{

Expand Down Expand Up @@ -305,10 +303,14 @@ private function sendRequest(Request $request): array
$auth = $this->getAuth();
$this->httpClient->setAuth($auth['username'], $auth['password']);

if ($this->generalConfig->getDebugLogging()) {
$this->logger->debug("Request: " . $request->renderRequestLine());
$this->logger->debug("Request headers:\n" . $request->getHeaders()->toString());
}
$response = $this->httpClient->send($request);

if ($this->generalConfig->getDebugLogging()) {
$this->logger->debug("Request response:\n $response");
$this->logger->debug("Request response:\n" . $response->toString());
}
// clear client for next request
$this->httpClient->reset();
Expand Down
4 changes: 4 additions & 0 deletions src/export/Model/UploadExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public function execute(ExportInterface $export): void
} else {
$dataId = $this->dataIntegrationClient->uploadFasData($zipFileName);
}
if ($dataId === null) {
$this->logger->error(__METHOD__ . ': Error uploading export to Fredhopper');
return;
}
$export->setDataId($dataId);
$export->setStatus(ExportInterface::STATUS_UPLOADED);
$this->exportResource->save($export);
Expand Down

0 comments on commit 01bae5e

Please sign in to comment.