JBIDE-18247 - better organized with better cancelation logic

This is a cleaned up version of the patch with better cancelation logic. Also, see inline notes
so we ignored any exception in past here ?

that does sound nasty - but just to be clear, what usecase does this new throw exception change/fix ?