Kirzilla Kirzilla - 4 months ago 14
PHP Question

php: catch exception and continue execution, is it possible?

Is it possible to catch exception and continue execution of script?

Answer

Sure, just catch the exception where you want to continue execution...

  try
  {
      SomeOperation();
  }
  catch (SomeException $e)
  {
      // do nothing... php will ignore and continue    
  }

Of course this has the problem of silently dropping what could be a very important error. SomeOperation() may fail causing other subtle, difficult to figure out problems, but you would never know if you silently drop the exception.