Bug 388802

Summary: [DataBinding] Log Errors when catching Exception in UpdateValueStrategy doSet & Co.
Product: [Eclipse Project] Platform Reporter: Michael Vorburger <mike>
Component: UIAssignee: Conrad Groth <info>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: christian.pontesegger, info, Lars.Vogel, psuzzi, pwebster, simon.scholz
Version: 4.2Keywords: bugday, helpwanted
Target Milestone: 4.6 M7   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/63294
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=5abd737b67125b8d85293f480f10b0fdc5b800a9
https://bugs.eclipse.org/bugs/show_bug.cgi?id=495789
Whiteboard:

Description Michael Vorburger CLA 2012-09-04 19:17:09 EDT
When things go wrong in DataBinding, they are hard to catch.

I do understand that the basic approach of binding makes the usual propagation of exceptions up the calling stack difficult (useless, who would catch it?), and that the ValidationStatus (IStatus) should be checked by e.g. a UI, but would argue that simply also providing more logging exceptions as error when caught inside Data Binding couldn't hurt and would help in development.

More specifically, I would suggest logging the Exception caught in org.eclipse.core.databinding.UpdateValueStrategy#doSet(), and related similar methods such as UpdateListStrategy's doAdd() & doMove() & doReplace() as well as UpdateSetStrategy's doAdd() & doRemove().

Logging "Framework" chosen probably wouldn't be slfj4j or similar API, but DataBinding's own Policy.getLog().log(new Status(IStatus.ERROR, Policy.JFACE_DATABINDING, 0, "..." / e.getMessage()?, e)); as elsewhere in the DataBinding codebase.

If you think this idea is of interest and prefer getting a concrete patch proposal / GitHub pull request instead of the textual proposal above, please let me know and I'll contribute one.
Comment 1 Christian Pontesegger CLA 2015-12-08 04:47:50 EST
*** Bug 483172 has been marked as a duplicate of this bug. ***
Comment 2 Lars Vogel CLA 2015-12-08 04:55:16 EST
Patches are welcome.
Comment 3 Lars Vogel CLA 2015-12-09 02:22:57 EST
Conrad told me that he is working on a patch.
Comment 4 Eclipse Genie CLA 2015-12-27 12:02:16 EST
New Gerrit change created: https://git.eclipse.org/r/63294
Comment 5 Conrad Groth CLA 2016-01-22 15:14:57 EST
Can someone please review the change?
Comment 6 Conrad Groth CLA 2016-03-06 13:04:26 EST
I would really appreciate if someone reviews this change.
Comment 8 Simon Scholz CLA 2016-04-12 06:16:03 EDT
Thanks for this patch, Conrad. I think a lot of users have been missing these exception logging, since they we somehow suppressed beforehand.