Jump to content
  • Advertisement
Sign in to follow this  
CProgrammer

catching unhandled exceptions

This topic is 3788 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a php script that executes a C++ application. Now in the unlikely event that the C++ app terminates with an unhandled exception how can I ensure that the php script catches this and continues working with appropriate measures. On Windows and apache I get an unhandled exception box which I close, much rather I would want this not to happen, instead have the php script deal wth it. I know a C++ app shouldnt have any exceptions of this kind but since you never knw I dont want this crashing the server or giing a user awkward responses. -CProgrammer

Share this post


Link to post
Share on other sites
Advertisement
You can have a try catch statement in your main function that covers everything the program does. Although "continues working with appropriate measures" will be difficult and specific to each cause of the exception.

Share this post


Link to post
Share on other sites
If the C++ program crashes, it will appear to your PHP script as though the program finished running. You don't need to do anything special to catch exceptions.

However, the crashed program still crashed, and so its a good bet that it didn't finish up whatever it was supposed to be doing. It is up to you to decide if that output is reliable, and if you could continue working.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!