So currently every code uses Exceptions.printStackTrace which was recommended by Netbeans a few years ago, however it has one major flaw: It only displays Exceptions to the caller, which is the IDE in which you debug the sdk, which is the console window you launch the SDK from or the log file one specified.
The Problem is in 99.9% of the cases, this is not available, the users can't be bothered to report failures then.
Disclaimer: I have not found a way to have this error dialog with the red X apart from not catching an exception and let netbeans handle it. So if you know something, input is welcomed.
What I currently found out is using something like what I did in 644e79d would work well: Notifying the user and using logging (you need Level.SEVEREfor the stack trace to be visible):
MessageUtil.error("Unable to convert the model: An Exception has occured.\n"
+ "Please look into the Output Window and report that Exception\n"
+ "(including the full stacktrace) to us at \n"
+ "https://github.com/jMonkeyEngine/sdk/issues");
logger.log(Level.SEVERE, "An Exception has occured.", ex);
The problem with MessageUtil.showException is that org.openide.NotifyDescriptor.Exception has been deprecated and one recommendation is java.util.logging or the Exceptions class, however for which research would have to be done to print the stack trace to the Dialog, so I'm going to assume that it's not possible, giving the logging guidelines.
To find out what would be affected, I did a quick grep which yielded 471 occurences, so that might be something for a lonely night.
So currently every code uses
Exceptions.printStackTrace
which was recommended by Netbeans a few years ago, however it has one major flaw: It only displays Exceptions to the caller, which is the IDE in which you debug the sdk, which is the console window you launch the SDK from or the log file one specified.The Problem is in 99.9% of the cases, this is not available, the users can't be bothered to report failures then.
Disclaimer: I have not found a way to have this error dialog with the red X apart from not catching an exception and let netbeans handle it. So if you know something, input is welcomed.
What I currently found out is using something like what I did in 644e79d would work well: Notifying the user and using logging (you need
Level.SEVERE
for the stack trace to be visible):The problem with
MessageUtil.showException
is thatorg.openide.NotifyDescriptor.Exception
has been deprecated and one recommendation is java.util.logging or the Exceptions class, however for which research would have to be done to print the stack trace to the Dialog, so I'm going to assume that it's not possible, giving the logging guidelines.To find out what would be affected, I did a quick grep which yielded 471 occurences, so that might be something for a lonely night.
It might be worth to discuss whether it's not possible to use Exceptions for that before doing such a large refactoring