Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Why ErrorDialog is not showing exception's stack trace from IStatus?
Why ErrorDialog is not showing exception's stack trace from IStatus? [message #803047] Mon, 20 February 2012 21:33 Go to next message
Libor Jelinek is currently offline Libor JelinekFriend
Messages: 143
Registered: January 2012
Location: Prague, Czech Rep.
Senior Member

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(
	at com.virtage.plexflow.system.LoginDialog.handleOk(
	at com.virtage.plexflow.system.LoginDialog.buttonPressed(
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(
	at org.eclipse.swt.widgets.TypedListener.handleEvent(
	at org.eclipse.swt.widgets.EventTable.sendEvent(
	at org.eclipse.swt.widgets.Widget.sendEvent(
	at org.eclipse.swt.widgets.Display.runDeferredEvents(
	at org.eclipse.swt.widgets.Display.readAndDispatch(
Caused by: java.lang.RuntimeException: Failed to build SqlSessionFactory due to exception
	at com.virtage.plexflow.db.PxSqlSessionFactory.<init>(
	at com.virtage.plexflow.system.SystemInfo.getSqlSessionFactory(
	at com.virtage.plexflow.system.LoginService.authenticate(
	... 25 more

Thanks for any ideas!
Re: Why ErrorDialog is not showing exception's stack trace from IStatus? [message #825336 is a reply to message #803047] Tue, 20 March 2012 18:42 Go to previous message
Mauricio Reyes is currently offline Mauricio ReyesFriend
Messages: 26
Registered: August 2011
Junior Member
Hi Libor, I had the same mistake and found the solution you posted in stackoverflow:

Just pin the link so anyone can check it.

Thanks for the post, was very useful to me.
Previous Topic:How to import .apk files into Eclipse
Next Topic:Functionality of "Working Sets..." menu bar action in Breakpoints View
Goto Forum:

Current Time: Fri Apr 20 22:33:55 GMT 2018

Powered by FUDForum. Page generated in 0.01384 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software