I'm using a API which is throwing checked exception in mostly methods, even a constructor is throwing a checked exception.
When using API methods I want to deal it with try catch all the time. Suppose I'm using some methods 10 times then I need to surround it in try catch block 10 times.
Thing is
- I don't want to propagate it to upper layer.
- I want to get rid of try catch block all the time I use those methods.
What could be the proper ways to handle this situation?
Someone told me about callable interface. How can we use it in this case?