开发者

max execution time error handling

开发者 https://www.devze.com 2023-01-05 04:00 出处:网络
I have one script that sometimes gives Max execution times reached error. This is normal, not this a problem. The开发者_开发百科 problem is that in this case I would write specific error message.

I have one script that sometimes gives Max execution times reached error. This is normal, not this a problem. The开发者_开发百科 problem is that in this case I would write specific error message.

How do i do this?


function say_goodbye() {
   if (connection_aborted()) {
      //  Perform some action if user has aborted the transaction
   } elseif (connection_status() == CONNECTION_TIMEOUT) {
      //  perform some other action if the connection has timed out
   } else {
      //  any normal completion actions
   }
}

register_shutdown_function("say_goodbye")

You can also pass parameters to the shutdown function


Use set_error_handler

http://php.net/manual/en/function.set-error-handler.php

0

精彩评论

暂无评论...
验证码 换一张
取 消