Why Catching Throwable or Error is bad?

90 views Asked by At

I often hear advice that catching Throwable or Error is bad practice and Java developer should avoid catching these, I don't know Why?

If language allows you to catch anything which is instance of java.lang.Throwable, then what is the problem of catching them or their subclass java.lang.Error?

If they are bad, shouldn't Java itself has prohibited them from catching?

Please suggest me the answer. Thanks in advance.

0

There are 0 answers