Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

PHP 5 Exception recovery

Posted on 2007-04-10
1
512 Views
Last Modified: 2010-08-05
Can you resume execution after an uncaught exception is picked up by the customized exception handler?

For example, in my error class:

set_exception_handler("userExceptionHandler");

If I have code that throws an exception which is not caught, userExceptionHandler() catches and handles it.  Can I recover from there?
0
Comment
Question by:Steve Bink
1 Comment
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
ID: 18887773
No, if the exception is handled by the global exception handler The script finish after that point. Example:

function myExceptionHandler (Exception $ex) { return true; }
set_exception_handler("myExceptionHandler");
throw new Exception("This should cause a fatal error and this message will be lost");
echo "Test";

'Test' is never printed.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Split wordpress loop 35 56
MVC - procedural PHP 10 38
selector:validator cookies 4 30
ability to create nested list on the UI using PHP, HTML, Javascript 7 45
These days socially coordinated efforts have turned into a critical requirement for enterprises.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question