Sun Seng David TAN | 8 Aug 11:33

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.
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
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)

Alain Escaffre | 8 Aug 10:43

Apogee list

Hello,

dev is mainly used for EP dev, so I propose to use apogee list  
(http://lists.nuxeo.com/mailman/listinfo/apogee) for communication on  
dev. If you are not already in the list (like me : -) ), please,  
suscribe and use it when mailing about Apogee

Sun will work  on improving apogee user interface, but before that he  
will clean up the code on three aspects :
	- Exception management
	- Logging (no more e.printstacktrace)
	- String externalisation so that Apogee can be used in different  
languages

Once this will be done, every body will have to respect the rules !

About  exception management, we should choose the pattern to be used,  
and I let you discuss about that. I guess all the exceptions should  
be thrown to the top so that there is systematically a UI signal when  
something is wrong ...

Thank you,

Alain

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