Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Bad Behavior

Sign in to follow this  


Just because your program behaves badly, doesn't mean your error messages have to. Today at work I encountered a bug that turned out to be wxWidgets running out of resources. It took me pretty much all day to track down, which is much longer than it should have. The problem was that when wxWidgets ran out of resources, it popped up a modal dialog. This dialog had the ever so helpful title of "Error", and the dialog consisted of an Ok button. That's it. No explanation of what went wrong or where it happened or how to fix it. Just a dialog titled "Error" with an Ok button.

But that wasn't the worst part. When this particular map was loaded in the editor, Unreal pops up a dialog box warning you that one of the level packages could not be found. Fine, whatever, it's a content issue, I'm sure they'll get it fixed soon. The big problem was that this dialog was coming up over the wxWidgets error message, making it loose focus. But, it's a modal dialog, so you can't do anything until you hit that Ok button. This is a problem. First off, I can't see the dialog, because Unreal's warning message is over it. Second, I can't close Unreal's warning, because any attempt to click the mouse just beeps at me, because there's a modal dialog open. Ugh.

At first, I just thought the program was freezing up when loading the level, because it stopped responding to everything. Then, I plugged in headphones and started hearing the Windows error sound every time I clicked the mouse. It ended up taking me the better part of the day to figure out what should have been a straightforward error.

So remember, even if your program does something wrong, don't make the error message behave badly. Give some information about what the error was, and how it might be fixed. And if it's an error that can be recovered from (as this was, if you could actually hit the Ok button, the program would run fine, you'd just be missing a few widgets), don't distract me with a modal dialog, just write out the error to the error log and continue on.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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!