I have multiple methods in class; each method has been declared with "throws Exception" option. Whenever an exception occurs I want one object present in this class to be wrapped automatically and create a custom exception object.
This newly created custom object is supposed to be thrown.
I don't want to create a try-catch block in every method and create a custom exception object, which would have the object I want to be wrapped along.
Is there a way to do it without above approach. If so what code changes do I need to do?