blob: 7ed57a16bf18de4b4ea95cec91e8b1f17d26de07 [file] [log] [blame]
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
= DevFaqUnexpectedExceptionDialog
:jbake-type: wiki
:jbake-tags: wiki, devfaq, needsreview
:jbake-status: published
:keywords: Apache NetBeans wiki DevFaqUnexpectedExceptionDialog
:description: Apache NetBeans wiki DevFaqUnexpectedExceptionDialog
:toc: left
:toc-title:
:syntax: true
=== How can I suppress the Unexpected Exception dialog?
If your code generates an uncaught exception at runtime or uses `Logger.log(Level l, String s, Throwable t)` with level => 900 (`Level.WARNING`), 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 link:DevFaqPlatformRuntimeProperties.asciidoc[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 automatically.
The above on its own doesn't suppress the exception dialog entirely - the dialog will still be shown if the user clicks on the error icon. To suppress that too, set `netbeans.exception.alert.min.level` to a high value as well (i.e. `99999`). This means your users will not even know there was a problem, and will have no opportunity to find out (or report it) unless they scan their log file.
See link:http://forums.netbeans.org/ptopic16746.html[http://forums.netbeans.org/ptopic16746.html] for details on how to set properties within NetBeans and in final applications.
=== Apache Migration Information
The content in this page was kindly donated by Oracle Corp. to the
Apache Software Foundation.
This page was exported from link:http://wiki.netbeans.org/DevFaqUnexpectedExceptionDialog[http://wiki.netbeans.org/DevFaqUnexpectedExceptionDialog] ,
that was last modified by NetBeans user Jglick
on 2011-08-29T14:59:19Z.
*NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.