Uncle Bob says in Clean Code book that Unchecked Exceptions should be used. Now JDK has some checked exceptions: IOException, IllegalAccessException etc. which cannot be avoided.
In my application logic suppose I have an exception:
public class MyDomainException extends RunntimeException {
public MyDomainException(Exception e) {
super(e);
}
//etc
}
And some code
try {
outputStream.write(someBytes);
} catch (IOException e) {
throw new MyDomainException(e);
}
Is this a good approach or should these checked exception be propagated up the ladder and filling the method signatures?
Edit: I understand this was asked and answered.
Can MyDomainException be used for business logic validation too or this exception should only be used for wrapping and other exception(s) should handle the business logic?
Edit: I would still like an answer to this question.