|
|
|
Re: HTTP ERROR 500 when a table tooltip raises an exception [message #878668 is a reply to message #878590] |
Tue, 29 May 2012 17:29 |
Rüdiger Herrmann Messages: 335 Registered: July 2009 |
Senior Member |
|
|
Sebastien,
if you are using the workbench, it installs an exception handler in
Window#setExceptionHandler() that handles exceptions in user code.
For RWT standalone it depends whether you use the JEE_COMPATIBILITY mode
or SWT_COMPATIBILITY mode.
When running in SWT_COMPATIBILITY mode, all exceptions are thrown from
Display#readAndDispatch(). By wrapping the event loop with a try-catch
block you can control what happens with exceptions that occur in your
code during event processing. This is the same approach which is used by
the default exception handler in Window.
For the JEE_COMPATIBILITY mode, there is currently no way to handle
exceptions, see this feature request [1].
Regards,
Rüdiger
[1] 367773: The JEE_COMPATIBILITY mode is missing central exceptions
handling
https://bugs.eclipse.org/bugs/show_bug.cgi?id=367773
On 29.05.2012 17:15, Sebastien Arod wrote:
> Hi Ivan,
>
> From what I experienced so far most of the time RAP handles exception
> raised from user code by logging the error and/or displaying an error
> dialog if it is not catched in user code. For instance if an exception
> is raised in CellLabelProvider.getText(Object) instead of
> CellLabelProvider.getToolTipText(Object) an error dialog is displayed
> instead of the Error 500.
>
> I agree that exceptions should be trapped in user code but sometimes
> it's not done and when unexpected exceptions happens it could be nicer
> to have an error dialog rather than having an HTTP error 500 that causes
> loosing the user session.
>
> Seeing that there was a difference in behavior between getToolTipText
> and other similar methods I was just wondering if this was the expected
> behavior.
>
>
> Regards,
> -Seb
--
Rüdiger Herrmann
http://codeaffine.com
|
|
|
|
Re: HTTP ERROR 500 when a table tooltip raises an exception [message #878949 is a reply to message #878939] |
Wed, 30 May 2012 08:51 |
Rüdiger Herrmann Messages: 335 Registered: July 2009 |
Senior Member |
|
|
Sebastien,
when using the workbench, exceptions from user code should end up in the
ExceptionHandler. I vaguely remember that JFace tooltips are handled
somewhat special as they aren't real widgets.
However, to me this looks like a bug (Ivan, please correct me if I'm
wrong). Would you mind to file a bugzilla, preferably along with a stack
trace?
Regards,
Rüdiger
On 30.05.2012 10:38, Sebastien Arod wrote:
> Hi Rüdiger,
>
> I use the workbench but even so the exceptions raised in
> getToolTipText() are not handled and cause an HTTP 500.
>
> I tried to debug and compare the behavior between RAP and RCP on this.
>
> In both RCP and RAP the exceptions are catched in
> org.eclipse.ui.internal.Workbench.runEventLoop(IExceptionHandler,
> Display) and passed to the ExceptionHandler class for handling.
>
> ExceptionHandler itself simply throws exception inheriting ThreadDeath
> and delegates the handling for other exceptions to
> WorkbenchAdvisor.eventLoopException(Throwable).
>
> However in RAP RWTLifeCycle.continueLifeCycle() wraps the original
> exception in a PhaseExecutionError (which extend ThreadDeath) before it
> reaches the handler so the exception is not logged by ExceptionHandler
> but it is instead re-thrown and handled at servlet level which cause the
> HTTP 500.
>
> So there is a difference in behavior between RAP and RCP right?
>
> Regards,
> -Seb
--
Rüdiger Herrmann
http://codeaffine.com
|
|
|
Re: HTTP ERROR 500 when a table tooltip raises an exception [message #878956 is a reply to message #878949] |
Wed, 30 May 2012 09:06 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Sounds like a bug to me too. Please attach to the bug a simple
self-running snippet/project that demonstrate the issue too.
Thanks,
Ivan
On 5/30/2012 11:51 AM, Rüdiger Herrmann wrote:
> Sebastien,
>
> when using the workbench, exceptions from user code should end up in
> the ExceptionHandler. I vaguely remember that JFace tooltips are
> handled somewhat special as they aren't real widgets.
> However, to me this looks like a bug (Ivan, please correct me if I'm
> wrong). Would you mind to file a bugzilla, preferably along with a
> stack trace?
>
> Regards,
> Rüdiger
>
> On 30.05.2012 10:38, Sebastien Arod wrote:
>> Hi Rüdiger,
>>
>> I use the workbench but even so the exceptions raised in
>> getToolTipText() are not handled and cause an HTTP 500.
>>
>> I tried to debug and compare the behavior between RAP and RCP on this.
>>
>> In both RCP and RAP the exceptions are catched in
>> org.eclipse.ui.internal.Workbench.runEventLoop(IExceptionHandler,
>> Display) and passed to the ExceptionHandler class for handling.
>>
>> ExceptionHandler itself simply throws exception inheriting ThreadDeath
>> and delegates the handling for other exceptions to
>> WorkbenchAdvisor.eventLoopException(Throwable).
>>
>> However in RAP RWTLifeCycle.continueLifeCycle() wraps the original
>> exception in a PhaseExecutionError (which extend ThreadDeath) before it
>> reaches the handler so the exception is not logged by ExceptionHandler
>> but it is instead re-thrown and handled at servlet level which cause the
>> HTTP 500.
>>
>> So there is a difference in behavior between RAP and RCP right?
>>
>> Regards,
>> -Seb
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03525 seconds