DevFaqUnexpectedExceptionDialog

(Difference between revisions)
(How can I suppress the Unexpected Exception dialog?)
(How can I suppress the Unexpected Exception dialog?)
Line 16: Line 16:
but using a very high value such as <tt>99999</tt> should prevent the dialog from ever being shown.
but using a very high value such as <tt>99999</tt> should prevent the dialog from ever being shown.
-
The above on its own doesn't suppress the alert dialog. You also need to set    <tt>netbeans.exception.alert.min.level</tt> to a high value as well (i.e. <tt>99999</tt>). See http://forums.netbeans.org/ptopic16746.html for details on how to set it within Netbeans and in final applications.
+
The above on its own doesn't suppress the alert dialog in Netbeans 6.5. You also need to set    <tt>netbeans.exception.alert.min.level</tt> to a high value as well (i.e. <tt>99999</tt>). See http://forums.netbeans.org/ptopic16746.html for details on how to set it within Netbeans and in final applications.

Revision as of 12:27, 30 November 2009

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 netbeans.exception.report.min.level. 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. You also need to set netbeans.exception.alert.min.level to a high value as well (i.e. 99999). See http://forums.netbeans.org/ptopic16746.html 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