I have a script that connects to a third-party API. It works and should work on a continuous 24/7 cycle (I use sleep at the end before restarting the cycle).
The problem is that sometimes a third-party API gets ddosed or the connection just crashes with this error:
Fatal error: exception for exception 'GuzzleHttp \ Ring \ Exception \ ConnectException' with the message 'cURL error 7: Could not connect to port xxx.com 443
Is there a way to โcrashโ this fatal error to make sure the code restarts and continues to work if the action can be completed, or should I manually restart every time I get this error?
source
share