How do i enforce custom exceptions in java

Hi,

We want to enforce only use of CustomException in our project, how do we enforce it instead of using generic exceptions

Hi,

Welcome to the community!

What language is this about?

 
Ann

It’s Java, mentioned in the title

1 Like

Hi,

Sorry I missed that.

There are two template rules that may help:

S3688 Track uses of disallowed classes
S4011 Track uses of disallowed constructors.

 
HTH,
Ann