Why ErrorDialog is not showing exception's stack trace from IStatus? [message #802433] |
Mon, 20 February 2012 00:26 |
|
Hello everbody!
Consider this example:
try {
LoginService.authenticate(sysinfo, user);
} catch (LoggingException e) {
Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e);
ErrorDialog.openError(getShell(), "Error", "Exception occured during authentication!", status);
}
Why JFace ErrorDialog is not showing full stack trace (same like e.printStackTrace()) after pressing "Details >>" button? Actually it is showing just e.getLocalizedMessage() (i.e. just name of exception):
That's useless. It should contain similar output like e.printStackTrace() to be helpful:
com.virtage.plexflow.system.LoggingException: Authentication failed due to exception
at com.virtage.plexflow.system.LoginService.authenticate(LoginService.java:44)
at com.virtage.plexflow.system.LoginDialog.handleOk(LoginDialog.java:333)
at com.virtage.plexflow.system.LoginDialog.buttonPressed(LoginDialog.java:252)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
Caused by: java.lang.RuntimeException: Failed to build SqlSessionFactory due to exception
at com.virtage.plexflow.db.PxSqlSessionFactory.<init>(PxSqlSessionFactory.java:76)
at com.virtage.plexflow.system.SystemInfo.getSqlSessionFactory(SystemInfo.java:84)
at com.virtage.plexflow.system.LoginService.authenticate(LoginService.java:42)
... 25 more
Thanks for any ideas!
[Updated on: Mon, 20 February 2012 00:29] Report message to a moderator
|
|
|
|
Re: Why ErrorDialog is not showing exception's stack trace from IStatus? [message #810599 is a reply to message #810258] |
Thu, 01 March 2012 10:03 |
|
What do you mean with "Policy", please?
Finally, I also found workaround with converting lines produced by printStackTrace() to MultiStatus.
Unfortunately I can't share a link in this topic here because I don't have enough "credit" (some kind of anti-spam policy). To overcome it please replace spaces with slashes.
http : / / stackoverflow . com / questions / 2826959 / jface-errordialog-how-do-i-show-something-in-the-details-portion /9404081#9404081
(I hope that I will not be banned because of this ).
|
|
|
|
Re: Why ErrorDialog is not showing exception's stack trace from IStatus? [message #810769 is a reply to message #810700] |
Thu, 01 March 2012 14:36 |
|
Sorry but I am confused what are differences among these means:
* JFace Policy object
* org.eclipse.ui.statusHandlers extention point
* WorkbenchAdvistor.eventLoopException() method
AFAIK they are very similar.
What is the highest (the most top) place to catch exceptions?
What is recommended place catch exception and show them as nicely polished dialog to the users?
Thanks
Libor
|
|
|
|
Powered by
FUDForum. Page generated in 0.04071 seconds