Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to show stack trace with error dialog in eclipse workbench
How to show stack trace with error dialog in eclipse workbench [message #459517] Mon, 04 December 2006 08:55 Go to next message
Eclipse UserFriend
Hi,

From WorkspaceJob.runInWorkspace(), we retun IStatus object, depending on
which eclipse backend reacts. If IStatus object is set to status
IStatus.ERROR, an error dialog appears. My intent is to show the actual
java error with the very error dialog, as well as the full stack trace. Is
it possible, please? Is it possible to install a custorm error dialog?

-Faisal
Re: How to show stack trace with error dialog in eclipse workbench [message #459637 is a reply to message #459517] Tue, 05 December 2006 03:56 Go to previous messageGo to next message
Eclipse UserFriend
Any help please...
Re: How to show stack trace with error dialog in eclipse workbench [message #459643 is a reply to message #459637] Tue, 05 December 2006 07:50 Go to previous messageGo to next message
Eclipse UserFriend
The ErrorDialog can be used to show a result of an IStatus message.

<a href=" http://help.eclipse.org/help21/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/jface/dialogs/ErrorDialog.ht ml">org.eclipse.jface.dialogs.ErrorDialog</a>

Alex.
Re: How to show stack trace with error dialog in eclipse workbench [message #459670 is a reply to message #459643] Wed, 06 December 2006 03:44 Go to previous messageGo to next message
Eclipse UserFriend
Yes, ErrorDialog can show the message associated with IStatus object. But
ErrorDialog does not show the stack trace. Is it possible to show the
stack trace anyway please? Any way to install custom error dialog with
eclipse please?
Re: How to show stack trace with error dialog in eclipse workbench [message #459675 is a reply to message #459670] Wed, 06 December 2006 06:52 Go to previous message
Eclipse UserFriend
You can easily build your own dialog if you want. ErrorDialog is a subclass of IconAndMessage, which is a subclass of Dialog, so if ErrorDialog doesn't quite do what you want, you can always create your own dialog message.

ErrorDialogs are supposed to be user-friendly, though, so you shouldn't necessarily want to have the stack trace displayed. It would be fairly easy to pass in the stacktrace as a string message if you wanted; you can either use printStackTrace(new PrintWriter(s = new StringWriter())); s.toString(), or alternatively build it up yourself.

I don't think you can replace Eclipse's dialog dynamically, but it's fairly easy to obtain the source for org.eclipse.jface.dialogs, then modifying the existing ErrorDialog and re-building the plugin, and then dropping it into your Eclipse install. I've used this technique to work around a few bugs that are in 3.2 that won't be available now until 3.3.

Instead of using dialogs, have you considered using the platform log service, which will probably log the stacktrace?

Platform.getLog("org.example.bundle").log(iStatusObject);

Alex.
Previous Topic:change file path to IFile object
Next Topic:Compile errors after setting dependencies between Rcp and NON-Rcp projects.
Goto Forum:
  


Current Time: Wed Mar 26 01:30:25 EDT 2025

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

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

Back to the top