File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -305,6 +305,7 @@ protected function exportGroupFunctions(int $batchSize, array $resources): void
305305 /**
306306 * @param callable(resource $stream): void $callback
307307 * @return void
308+ * @throws \Exception
308309 */
309310 private function withCsvStream (callable $ callback ): void
310311 {
@@ -313,11 +314,19 @@ private function withCsvStream(callable $callback): void
313314 }
314315
315316 if ($ this ->device ->getType () !== Storage::DEVICE_LOCAL ) {
316- $ this ->device ->transfer (
317- $ this ->filePath ,
318- $ this ->filePath ,
319- new Device \Local ('/ ' ),
320- );
317+ try {
318+ $ success = $ this ->device ->transfer (
319+ $ this ->filePath ,
320+ $ this ->filePath ,
321+ new Device \Local ('/ ' ),
322+ );
323+ } catch (\Exception ) {
324+ $ success = false ;
325+ }
326+
327+ if (!$ success ) {
328+ throw new \Exception ('Failed to transfer CSV file from device to local storage. ' );
329+ }
321330 }
322331
323332 $ stream = \fopen ($ this ->filePath , 'r ' );
You can’t perform that action at this time.
0 commit comments