Jump to content

  • Log In with Google      Sign In   
  • Create Account

Adding a crash report screen


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 nerdboy64   Members   -  Reputation: 530

Like
0Likes
Like

Posted 06 January 2014 - 05:39 PM

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.


My website: Brass Watch Games

Come check out Shipyard, my first real game project (Very WIP): Game Website Development Journal

Shipyard is a 2D turn-based strategy with a sci-fi theme, in which you build ships from individual parts rather than being given a selection of predefined models.


Sponsor:

#2 ChaosEngine   Crossbones+   -  Reputation: 2352

Like
0Likes
Like

Posted 06 January 2014 - 11:13 PM

I believe you want Thread.UncaughtExceptionHandler


if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

#3 nerdboy64   Members   -  Reputation: 530

Like
0Likes
Like

Posted 06 January 2014 - 11:48 PM

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.


My website: Brass Watch Games

Come check out Shipyard, my first real game project (Very WIP): Game Website Development Journal

Shipyard is a 2D turn-based strategy with a sci-fi theme, in which you build ships from individual parts rather than being given a selection of predefined models.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS