tags:

views:

42

answers:

3

Hi All,

I want to suppress the timeout error in a script that is running automatically. The fact that the script is timing out is not a problem since it will be running again in a minute after the timeout. I DO want all other errors reported.

Any ideas?

+2  A: 
set_time_limit(0);

This will simply remove the timeout. Maybe that's enough?

nikic
I actually just set the timeout, so the cron jobs wouldn't overlap if there was more data than they could handle. I just don't want this to throw an error, since it's not
postmeridiem
+3  A: 

In case @nikic's answer is not what you are after, you can use

to setup a custom error handler that can handle the particular error.

Gordon
+1  A: 
function suppress_timeout() {
   if (connection_status() == CONNECTION_TIMEOUT) {
      // do your own thing here
   }
}

register_shutdown_function("suppress_timeout");
Mark Baker