I have a PHP script that needs to be executed for hours and hours and sometimes for some reasons (for example network problem while executing of a script which needs to be connected to internet ,etc...) the execution process stops for a while and does wrong thing(and it always causes a E_NOTICE while the process is going to wrong way)
My question is that is there ((any)) way to notice when there is a warning in your script?(And stop the whole script as well)
There is a Pseudocode for my question:
if( ThereIs(AnyWarning) ) {
exit("Sorry! You have 1 E_NOTICE so we should stop script!");
}
I hope you understood what i mean :)
Thank You In Advance!
Check set_error_handler this will be helpful for your requirement. you can exit or you can log error in it. or you can add logic if error/notice occurs in code redirect to error page.