Delete java rule S112: 'Generic exceptions should never be thrown'

I understand your position, but I’m not worried about the knowledge of the implementation. I worry about the dependency on the implementation. As I said, clients won’t care if the save is done using a SQL Database or a Message Queue. The declaration of a possible SQLException means clients depend on that RDBMS, and that the clients must recompile if the implementation changes to a Message Queue. That is not low coupling and it is not separation of concerns. IOW. this declaring of possible exceptions, is at odds with two vastly more powerful design principles. Therefore it should be discarded.

1 Like