Revision as of 16:06, 3 December 2009 by Dsimonek (Talk | contribs)

How can I suppress the Unexpected Exception dialog?

If your code generates an uncaught exception at runtime, NetBeans will display a dialog box which can show the details of that exception to the user. This is a welcome alternative to simply crashing the application, and provided you have written solid code, your user should never see this dialog anyway.

But it is impossible to handle every possible exception or error, and some developers might wish to simply suppress this dialog so that the application neither crashes nor alerts the user that an uncaught exception/error was thrown. You can do this by setting a system property at runtime named The exact value of this property will depend on certain factors such as whether or not assertions are enabled, but using a very high value such as 99999 should prevent the dialog from ever being shown.

The above on its own doesn't suppress the alert dialog in NetBeans 6.5 and newer. You also need to set netbeans.exception.alert.min.level to a high value as well (i.e. 99999). See for details on how to set it within NetBeans and in final applications.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo