Post

2 followers Follow
0
Avatar

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

Stephan Janosch

Please sign in to leave a comment.

2 comments

0
Avatar

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,
Matthew

Matthew Cheung 0 votes
Comment actions Permalink
0
Avatar

Thanks for the answer!

Indeed ExtractAnnotationsOperation throws an exception. Catching it solves the problem.

Thanks for give me the correct hint!

 

Stephan Janosch 0 votes
Comment actions Permalink