Skip to content
Advertisement

Tag: exception

What are the best practices for catching and re-throwing exceptions?

Should caught exceptions be re-thrown directly, or should they be wrapped around a new exception? That is, should I do this: or this: If your answer is to throw directly please suggest the use of exception chaining, I am not able to understand a real world scenario where we use exception chaining. Answer You should not be catching the exception

Advertisement