I would like to catch an exception, register it, set a flag and repeat the same exception
I have this code:
public Boolean doJobWithResult() { boolean result = true; final Feed feed = Feed.findById(feedId); try { feed.fetchContents(); } catch (Exception ex) { result = false; Logger.info("fetching feed(%d) failed", feedId); throw ex; } return result; }
But eclipse complains about throw ex, saying that it is "Unhandled exception type Exception", and offers me to add a try-catch block around it.
Actually, I want the process to call this method to handle the exception, and not handle it myself ... I just want to return true if everything is ok, and write it down if there is an exception
On the other hand, I can wrap an exception in another exception, but I cannot throw it.
any idea?
opensas
source share