File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1212use Magento \Framework \Filesystem \Io \File ;
1313use Psr \Log \LoggerInterface ;
1414
15- use function PHPUnit \Framework \stringStartsWith ;
16-
1715class 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 ();
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments