Advertisement Jump to content
Sign in to follow this  
nerdboy64

Adding a crash report screen

This topic is 1837 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

I'm making a game in Java using the Swing API, and since it's (A) my first game and (B) very early in development, I feel it would be helpful if users could send in crash reports such that I can track down bugs. I've already coded a simple crash screen which takes any exception in its constructor and generates a report with system information and the stack trace. However, I can't seem to find a way to detect fatal errors when they occur.

 

I tried wrapping the game loop in a try/catch, with the catch leading to the crash screen, but that doesn't help with errors that come from other parts of the program, for example methods triggered by mousePressed() or that are part of the rendering (update(), repaint(), paint(), etc.) family. What I'm wondering is if there's a  way to detect when the game is unable to continue, and automatically close the main window and display the error report.

 

Any suggestions are much appreciated.

Share this post


Link to post
Share on other sites
Advertisement

I believe you want Thread.UncaughtExceptionHandler

I actually tried that, and the result was the same: only caught errors thrown from somewhere in the game loop and not the mouse/keyboard/rendering sections.

 

I suppose, worse comes to worst, that I could move all the rendering and mouse/keyboard handling inside the game loop with some crude "events" system, but that seems needlessly complicated for a feature which is designed to prevent errors.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!