PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
hi! there .i have a script that runs fie until the connection was very bad.now 've realised that the normal try and catch i've done are not working very well.so i cange it to :
actually, it's a api call. i use file with get parameter in the address to have an session id before i send sensitive info with that session id to another url with a proper curl request
i'll try that. the file does the job in one line.Don't you know any king of mesure to catch error either for file and curl if for example the connection break? as i say the normal try and catch seems not to be working, same if i throw the exception myself.Am i doing something wrong?
You can only catch exceptions if they are thrown before a fatal error. Since you are calling a php function which fails with a timeout before you can throw the exception, your error handling will not work.
i thinks i understand the point.Now its time for alternatives.the application is abuot to send sms on the net and its working as i told you.this part of the application that is giving me the problem is related to giving a delivery status at least 40 seconds after the message has been send with a modal pop up.so i query for the status with the message id by calling the api (this is the very one that show the ) in a loop 5 times.
PS: i have a proper cron job which would do that every 5mn.But for user experience i thought i should give a temporary delivery status after 40 seconds.
That's it.
Need to think differently for that, so i need your suggestion.Thanks for helping