Merge branch 'handleGuzzleConnectionErrorForCafel' into 'develop'

HandleGuzzleConnectionErrors on Cafel fucking calls

See merge request service-web-lab/tracabilite-loue!12
This commit is contained in:
Vincent BRIDIER 2022-12-06 10:50:34 +00:00
commit 82202efb3c

View file

@ -3,6 +3,8 @@
namespace App\Jobs;
use App\Lib\CafelApi\Models\CafelClientModel;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
@ -84,7 +86,11 @@ abstract class CafelJobs implements ShouldQueue
$attribute => collect($messages)->implode(', ') . $verifiedValue
];
})->implode(' '))->all();
}
} catch (ConnectException | RequestException $e) {
// ! Guzzle SSL Error connection failure
\report($e);
$this->invalidRows[] = collect($row)->put('validation_message', $e->getMessage())->all();
}//end try
}//end foreach
} while (!empty($result));
}