Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Exception classes implementing interface

$
0
0

I have a bunch of my application specific exceptions.

For ex:

ProductNotFoundExceptionOutOfStockExceptionDiscontinuedProductException......

I think these exception classes can implement an interface. I would like to expose some data as part of exception

   ex.getErrorCode()   ex.getProductId()

But is it a good practice?. Do we have any such example within JDK ?


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>