Why is it best to not catch exceptions in general-purpose classes?
问题 When you implement a class for some general-purpose use, why is it best not to catch exceptions? I suppose it's so that the error can go up the stack and help in the debugging process. Any other reasons? 回答1: This rule should better read: Do not handle Exceptions you do not know how to handle! If e.g. you write a class that reads a CSV file and return the tokens of the line, you will have some points in your class where an IOException might be thrown. You should definitely not catch it,