Adding a crash report screen

Started by
1 comment, last by nerdboy64 10 years, 3 months ago

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.

Advertisement

I believe you want Thread.UncaughtExceptionHandler

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

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.

This topic is closed to new replies.

Advertisement