Sun Seng David TAN | 8 Aug 11:29

Exceptions handling

Hi Apogee devs,

It's time to think about errors and exception handling in Apogee. The 
purpose of this discussion is to get rid of "printstacktrack" way to 
easily avoid the problem and find a new and simple way to warm the user 
and give good information for the developpers if debugging is needed.

To start the discussion, in a first glance, Alain said :
"I guess all the exceptions should be thrown to the top so that there is 
systematically a UI signal when something is wrong ... "

I think we have few ways to handle exception :
• logging -> reuse existing nuxeo way to handle them (log4j) ?
• display to user -> IStatus (the message it self and status) and 
ErrorDialog, maybe in the Status bar as well.

I think Apogee should have its own way to deal with exception. Because 
it is supposed to handle not only nuxeo, we should embed nuxeo handled 
exception from coming the core.

Any idea is welcome :)

Sun.
Bogdan Stefanescu | 8 Aug 12:33

Re: Exceptions handling

Sun Seng David TAN wrote:
> Hi Apogee devs,
>
> It's time to think about errors and exception handling in Apogee. The 
> purpose of this discussion is to get rid of "printstacktrack" way to 
> easily avoid the problem and find a new and simple way to warm the 
> user and give good information for the developpers if debugging is 
> needed.
>
> To start the discussion, in a first glance, Alain said :
> "I guess all the exceptions should be thrown to the top so that there 
> is systematically a UI signal when something is wrong ... "
>
> I think we have few ways to handle exception :
> • logging -> reuse existing nuxeo way to handle them (log4j) ?
> • display to user -> IStatus (the message it self and status) and 
> ErrorDialog, maybe in the Status bar as well.
>
Logging should be done using slf4j or apache.logging API as in nuxeo 
ecm. (nuxeo runtime and other core plugins already use this)
To be able top use logging you need to have org.nuxeo.logging in your 
plugin dependencies.

Displaying errors to user should be done using 
org.nuxeo.eclipse.ui.utils.UI.showError().
I think there is a bug in this method and the stack trace is not 
displayed in the dialog - can you look at this Sun?

> I think Apogee should have its own way to deal with exception. Because 
> it is supposed to handle not only nuxeo, we should embed nuxeo handled 
(Continue reading)

Sun Seng David TAN | 8 Aug 12:42

Re: Exceptions handling

Bogdan Stefanescu a écrit :
> Displaying errors to user should be done using 
> org.nuxeo.eclipse.ui.utils.UI.showError().
> I think there is a bug in this method and the stack trace is not 
> displayed in the dialog - can you look at this Sun?
Yep ... i've notice this issue, i'm looking harder

Re: Exceptions handling

Hi,

another way to display errors is to use status line/Eclipse Console. 

For  example :
    Exception message can be displayed on status line with a proper
error icon ... and click on that the Eclipse console will be displayed
with full stacktrace...

    IMHO popus are very annoying.

Regards,
E.

Bogdan Stefanescu wrote:
> Sun Seng David TAN wrote:
>> Hi Apogee devs,
>>
>> It's time to think about errors and exception handling in Apogee. The
>> purpose of this discussion is to get rid of "printstacktrack" way to
>> easily avoid the problem and find a new and simple way to warm the
>> user and give good information for the developpers if debugging is
>> needed.
>>
>> To start the discussion, in a first glance, Alain said :
>> "I guess all the exceptions should be thrown to the top so that there
>> is systematically a UI signal when something is wrong ... "
>>
>> I think we have few ways to handle exception :
>> • logging -> reuse existing nuxeo way to handle them (log4j) ?
(Continue reading)


Gmane