I use Sugarpro version 126.96.36.199 and I've made an integration with a third party financial platform. Each night I have programmed a custom scheduler to send some data to this platform with php CURL. In this scheduler a use a while statement that sends each time a Curl json request to the platform. If this call has an httpcode response of 200, I update the relative record on Sugar and proceed to the next record. If this call has a different httpcode response, I need to differently update the record and send an email alert.
However when this occurs, the record is correctly updated but the scheduler exit the loop with the classic error "failed in CRON run". Since I have set up the scheduler to execute again if a fault occurs, after a minute the scheduler restart the process.
Instead of this behavior I need the scheduler goes on even if the CURL call goes wrong.
Why a CURL error block the scheduler?
I tried to insert the code in a try / catch function but the scheduler exit all the same.
The main error, in this case, is not about Sugar, but in the financial platform and we are managing the case with the supplier, however maybe useful to avoid the exit code for the scheduler even if the Curl call goes wrong.
Is there a way to do this?
Thank you in advance.