Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » VetoException within WizardStep logged with severity WARN
VetoException within WizardStep logged with severity WARN [message #1823284] Tue, 24 March 2020 10:51 Go to next message
Samuel   is currently offline Samuel Friend
Messages: 22
Registered: January 2012
Junior Member
In our project, we make extensive use of the Scout wizard. We display forms inside the Scout wizard. When such a form is validated in the execDeactivate method of the wizard step, the form may throw a VetoException e.g. due to missing mandatory fields.
We observed, however, that such VetoExceptions are logged with severity = WARN whereas VetoExceptions on normal forms (i.e. forms not residing within a wizard step) are logged with severity INFO.

The reason why VetoExceptions on forms within a wizard step are logged with severity = WARN is because such exceptions are handled by the CallableChainExceptionHandler.

We do not want to log VetoExceptions as warnings because they do not point at a possible error in the code. What would you recommend me to do?

A possible way to deal with this would be to implement my own CallableChainExceptionHandler and to register it in my own JobManager. In my own CallableChainExceptionHandler, I could treat VetoExceptions separately.
Re: VetoException within WizardStep logged with severity WARN [message #1823285 is a reply to message #1823284] Tue, 24 March 2020 11:02 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
Hi Samuel

Usually you don't have to fiddle with the code that produces the log-message. Instead you'd provide a configuration for the logging framework that suits your specific requirements. By default scout uses logback. You can provide a log-configuration in /src/main/resources/logback.xml. An example on how to exclude a specific class from the log is here.

Cheers,
André


Eclipse Scout Homepage | Documentation | GitHub
Re: VetoException within WizardStep logged with severity WARN [message #1823900 is a reply to message #1823285] Fri, 03 April 2020 14:46 Go to previous messageGo to next message
Samuel   is currently offline Samuel Friend
Messages: 22
Registered: January 2012
Junior Member
Hi André,

Thanks for your reply and the hint with the logback.xml. As far as I understand, the logback.xml only allows to configure the log level per class. I.e. I could decide whether WARN-Messages from my class should be logged or not.
However, we want to suppress log output, if the exception in the class CallableChainExceptionHandler is a VetoException. Other exceptions should be logged as usual.

Are there any other suggestions how to deal with this?

Thanks, Samuel
Re: VetoException within WizardStep logged with severity WARN [message #1824019 is a reply to message #1823900] Mon, 06 April 2020 14:57 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
I see. Logback has a filter-feature which could work for you in that case. See here or google for logback and filters for more examples/ideas. I haven't tried that for myself, but it looks promising ;-)

What I don't understand is why you end up in the CallableChainExceptionHandler when a VetoException is thrown. When I tested your case, the log message was always written by org.eclipse.scout.rt.platform.exception.ExceptionHandler. Which Scout version do you use? Could you post a stracktrace from a breakpoint in your application in the CallableChainExceptionHandler? In the "missing mandatory fields" case: do you throw a VetoException in your own code or is the VetoException created and thrown by the Scout framework? Is the VetoException created by the server or by the client?


Eclipse Scout Homepage | Documentation | GitHub
Re: VetoException within WizardStep logged with severity WARN [message #1824121 is a reply to message #1824019] Wed, 08 April 2020 09:28 Go to previous messageGo to next message
Samuel   is currently offline Samuel Friend
Messages: 22
Registered: January 2012
Junior Member
Hi André,

Thanks for pointing out the possibility of a filter. That would indeed be a clever place to exclude unwanted log output.

I have attached log outputs from two situations:

(1) A form is opened, changes to this form are made, and the form is stored. The server makes checks of the entered data and decides to throw a VetoException.
--> In the GUI, a message box containing the VetoException message appears.
--> The VetoException is logged as a log message with severity INFO

(2) The same form is opened but as an embedded form within a wizard step. Changes to the form are made, and the form is stored. The server again throws a VetoException.
--> In the GUI, a message box containing the VetoException message appears.
--> The VetoException is logged (1) as message with severity WARN. The log also contains the stack trace. (Note that the VetoException is additionally logged as message with severity INFO.

Cheers, Samuel
Re: VetoException within WizardStep logged with severity WARN [message #1824199 is a reply to message #1824121] Thu, 09 April 2020 11:35 Go to previous messageGo to next message
Adrian Egloff is currently offline Adrian EgloffFriend
Messages: 1
Registered: July 2014
Junior Member
Hi Samuel

Funny, we ran into the same problem last week during a regression test. This behaviour is surely not as expected and we fixed in the current Scout version by handling the VetoException separately: https://git.eclipse.org/r/#/c/160444/

So you should get the fix with the next release, otherwise you can, as you mentioned before, create a custom CallableChainExceptionHandler and override the JobManager to return your implementation.

Cheers,
Adrian
Re: VetoException within WizardStep logged with severity WARN [message #1826398 is a reply to message #1824199] Fri, 24 April 2020 11:45 Go to previous message
Samuel   is currently offline Samuel Friend
Messages: 22
Registered: January 2012
Junior Member
Hi Adrian,

Thank you for your answer and the fix in the Scout framework.

Regards, Samuel

[Updated on: Fri, 24 April 2020 11:45]

Report message to a moderator

Previous Topic:Exporting table to Excel in scout 10
Next Topic:Change css style of AbstractImageTile
Goto Forum:
  


Current Time: Thu Apr 18 12:35:53 GMT 2024

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

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

Back to the top