0

I have an program which is generating pdf reports with cron job. now sometimes fatal error is coming and i am trying to handle that with try catch block

$pdfcalass->display();
$pdfcalass->Output("$filename",'F');

i need to handle the fatal error generating in calling two function. i have tried this

register_shutdown_function('shutdownFunction',$request_id);
$pdfcalass->display();
$pdfcalass->Output("$filename",'F');

But Not working

Deepesh
  • 180
  • 16
  • Possible duplicate of [How do I catch a PHP Fatal Error](http://stackoverflow.com/questions/277224/how-do-i-catch-a-php-fatal-error) – Jigar Dec 30 '15 at 07:09

1 Answers1

0

To get the last error in php error_get_last:

function shutdownFunction($request_id){
    // something with $request_id;
    print_r(error_get_last());
}
register_shutdown_function('shutdownFunction', $request_id);
Jigar
  • 3,256
  • 1
  • 30
  • 51