﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
12805	More detailed bug reports	michael2402	michael2402	"Currently, bug reports only contain the stack trace of the method that threw the exception. We know which part of code threw the exception but we do not know which part of the data.

I want to allow custom variables to be added the the bug report. We can add catch blocks to the code that add information about the data that caused the exception. This should not contain really sensitive information but I think that adding e.g. the OSM ID is OK.

A report cold look like this:
{{{
== Stacktrace ==
<Full Java Stacktace>

== StyledMapRenderer#render ==
primitive: {Node id=...}

== OsmDataLayer#paint ==
virtualNodes: true

== MapView#paintLayer ==
layer: OsmDataLayer@...
bounds: Bounds[...]
}}}

For adding this, I suggest to use:
{{{
try {
    ... do some things that might crash here ...
} catch (Throwable t) {
    throw BugReports.create(t).put(""name"", value);
}
}}}

The mechanics behind this:
- BugReports.create wraps `t` with a new BugReportingException.
- The method calling this is automatically added.
- This exception has a put(key, value) method that allows us to add any String values to it. toString() is called in a catch block to avoid more exceptions.
- put returns the same exception for easy chaining.
- You can simply throw that BugReportingException - it will be caught by the global exception handler.

If you want to not throw the exception, you can use `BugReportingException#display()`. This displays the error dialog to the user and lets JOSM continue. This is useful e.g. for map painting: we do not want to freeze JOSM just because there is an error in the render engine - the rest of it should still work and allow you to save your changes.

There should be no performance impact - try blocks do not generate any java bytecode and we don't care about performance after an exception occurred.

While doing this, I want to improve the error report dialog to include more information. There should be only 2 dialogs:
(1) A status report that informs the user of what happend and what can be done (update, ...)
[[Image(josm-errors.png​)]]
(2) A dialog allowing the user to prepare the bug report.
[[Image(josm-errors2.png​)]]

The steps to implement this are:
(1) Add the bug report code for rethrow only. Timeframe: May 23 to May 27.
(2) Create the new Bug report dialog and replace the old code (big patch)  Timeframe: May 30 to June 10.
(4) Add catch blocks to the code on strategic places, replace Main.error(t) using the new dialog where appropriate. (Timeframe: -)

While doing this, I want to add all bug report related code to the package `...josm.tools.bugreport`"	enhancement	closed	normal	16.08	Core bugreport		fixed	gsoc-core	Don-vip bastiK stoecker
