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 ?