Reusing com.biomatters.plugins.extractAnnotations.ExtractAnnotationsOperation with one error and multiple good results cancels whole operation
Hello,
I reuse com.biomatters.plugins.extractAnnotations.ExtractAnnotationsOperation in a way that I call that plugin multiple times from my own plugin. When one of these reuses fails, everything seems to fail. Where does this behaviour come from? Why can't it simply return a empty result list and my plugin calls it again with the next annotation name of interest?
Again, link to plugin: https://git.mpi-cbg.de/gef/extractAnnotationListPlugin/blob/master/src/de/mpicbg/gef/extractannotationlist/GefExtractAnnotationListPlugin.java
Is there something in com.biomatters.plugins.extractAnnotations.ExtractAnnotationsOperation which manipulates the operation context in case of a fail?
Thanks,
Stephan
-
Hi Stephan,
How is it currently failing. My guess is that the operation is throwing a DocumentOperationException. You could catch the exception inside your loop, add an empty list at that point and then continue.
If you do that then you might want to keep track of which ones failed so you can tell the user afterwards.
Cheers,
Matthew0 -
Thanks for the answer!
Indeed ExtractAnnotationsOperation throws an exception. Catching it solves the problem.
Thanks for give me the correct hint!
0
Please sign in to leave a comment.
Comments
2 comments