How to handle validation problems? [message #1108300] |
Fri, 13 September 2013 12:54  |
Eclipse User |
|
|
|
Hello,
Sometimes I am getting a ridiculous amount of validation exceptions (shown in the same amount of dialogs, making my system quite unresponsive).
So I thought it is time to prevent this (e.g. by ignoring validation problems after 10 are found).
With the current EvlValidator class this is not really possible.
The EvlValidator.validate(Resource, Map<Object, Object>) catches exception and show them in a log + dialog.
I have some thoughts about this:
- When an exception is caught, the validation should be canceled... Now it continues, which is not likely the perform the validation correctly.
- The method does not provide means to let the callee know whether an exception occurred... E.g. via a return value or a rethrown exception
My opinion is to cancel the validation when an exception occurs (point 1) and throw a new exception telling what went wrong (point 2), instead of directly logging them.
The newly thrown exception can be caught in the validate(EClass, EObject, DiagnosticChain, Map<Object, Object>) method and added to the log, to keep the default behavior.
But now a custom validator is able to handle them as desired. E.g. keeping a counter and stop showing the exceptions after a certain threshold is reached.
Any additional thoughts about this subject?
Again, I am willing to provide a patch when a consensus is achieved.
Have a good weekend!
Cheers,
Maarten
|
|
|
|
|
|
Re: How to handle validation problems? [message #1111445 is a reply to message #1111212] |
Wed, 18 September 2013 04:16  |
Eclipse User |
|
|
|
Hello Dimitris,
Dimitris KolovosI've added a logErrors field to EvlValidator which should allow you to disable error logging [1] and released a new interim version that includes the fix.
Thanks a lot, this version does the trick for me!
Dimitris KolovosRegarding LogUtil, we'll need to think about where we should move it a bit more (we'll probably need to split the common.dt plugin and introduce a new feature). Please feel free to file an enhancement request so that we can keep track of this.
I now would like to use the LogUtils to notify the user that error reporting and logging is disabled. So this issue is still current.
I opened Bug #417482 to discuss this further.
Cheers,
Maarten
|
|
|
Powered by
FUDForum. Page generated in 0.26871 seconds