0

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?

3 Answers3

3

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.

Community
  • 1
  • 1
Gordon
  • 312,688
  • 75
  • 539
  • 559
2
set_time_limit(0);

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

NikiC
  • 100,734
  • 37
  • 191
  • 225
  • 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 Aug 06 '10 at 10:06
1
function suppress_timeout() {
   if (connection_status() == CONNECTION_TIMEOUT) {
      // do your own thing here
   }
}

register_shutdown_function("suppress_timeout");
Mark Baker
  • 209,507
  • 32
  • 346
  • 385