source: josm/trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandler.java@ 12538

Last change on this file since 12538 was 10819, checked in by Don-vip, 8 years ago

fix #13352 - new bug report queue (patch by michael2402) - gsoc-core

  • Property svn:eol-style set to native
File size: 914 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools.bugreport;
3
4/**
5 * An exception handler that asks the user to send a bug report.
6 *
7 * @author imi
8 * @since 40
9 */
10public final class BugReportExceptionHandler implements Thread.UncaughtExceptionHandler {
11
12 @Override
13 public void uncaughtException(Thread t, Throwable e) {
14 handleException(e);
15 }
16
17 /**
18 * Handles the given exception
19 * @param e the exception
20 */
21 public static synchronized void handleException(final Throwable e) {
22 BugReport.intercept(e).warn();
23 }
24
25 /**
26 * Determines if an exception is currently being handled
27 * @return {@code true} if an exception is currently being handled, {@code false} otherwise
28 */
29 public static boolean exceptionHandlingInProgress() {
30 return BugReportQueue.getInstance().exceptionHandlingInProgress();
31 }
32}
Note: See TracBrowser for help on using the repository browser.