]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6298 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Sep 2023 12:21:42 +0000 (14:21 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Sep 2023 12:21:42 +0000 (14:21 +0200)
app/Fluidbook/Farm.php

index 77297099bfd91dc7697aabc4a593a81f4f927fca..4dd8b12e6fabc3b21f7725e8997707067028eb42 100644 (file)
@@ -10,6 +10,7 @@ use hollodotme\FastCGI\Requests\PostRequest;
 use hollodotme\FastCGI\SocketConnections\NetworkSocket;
 use Illuminate\Support\Facades\Cache;
 use Illuminate\Support\Facades\Log;
+use Mockery\Exception;
 
 class Farm
 {
@@ -150,7 +151,11 @@ class Farm
             if (file_exists($path)) {
                 return $path;
             }
-            return self::_getFile($params, 0);
+            try {
+                return self::_getFile($params, 0);
+            } catch (Exception $e) {
+                return false;
+            }
         });
 
         if ((!$res || !file_exists($res)) && $attempts > 0) {
@@ -193,10 +198,10 @@ class Farm
 
         if (!$res) {
             if ($attempts > 0) {
-                Log::warning('Farm failure : ' . $output);
+                Log::warning('Farm failure ('.$farmer['name'].') : ' . $output);
                 return static::_getFile($params, $attempts - 1);
             }
-            throw new \Exception('Farm failure : ' . $output);
+            throw new \Exception('Farm failure  ('.$farmer['name'].')  : ' . $output);
         }
 
         return $res;