Skip to content

Commit 01bae5e

Browse files
Merge pull request #51 from aligent/fix/type_error
Fix/type error
2 parents fa0323e + d6e518a commit 01bae5e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/export/Model/Api/DataIntegrationClient.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
use Magento\Framework\Filesystem\Io\File;
1313
use Psr\Log\LoggerInterface;
1414

15-
use function PHPUnit\Framework\stringStartsWith;
16-
1715
class DataIntegrationClient
1816
{
1917

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

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

310312
if ($this->generalConfig->getDebugLogging()) {
311-
$this->logger->debug("Request response:\n $response");
313+
$this->logger->debug("Request response:\n" . $response->toString());
312314
}
313315
// clear client for next request
314316
$this->httpClient->reset();

src/export/Model/UploadExport.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public function execute(ExportInterface $export): void
6666
} else {
6767
$dataId = $this->dataIntegrationClient->uploadFasData($zipFileName);
6868
}
69+
if ($dataId === null) {
70+
$this->logger->error(__METHOD__ . ': Error uploading export to Fredhopper');
71+
return;
72+
}
6973
$export->setDataId($dataId);
7074
$export->setStatus(ExportInterface::STATUS_UPLOADED);
7175
$this->exportResource->save($export);

0 commit comments

Comments
 (0)