Inspectopedia Help

Class directly extends 'Throwable'

Reports classes that directly extend java.lang.Throwable.

Extending java.lang.Throwable directly is generally considered bad practice. It is usually enough to extend java.lang.RuntimeException, java.lang.Exception, or - in special cases - java.lang.Error.


class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable'

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Java, 233.SNAPSHOT

Last modified: 13 July 2023