So my question is this :
Basically I've a method with a try-catch block where I'm catching a WebApplicationException (javax.ws.rs.WebApplicationException) but my method is throwing NotFoundException (com.sun.jersey.api.NotFoundException) .
so I wanted to handle both like this :
try {
} catch (WebApplicationException e | NotFoundException e) {
}
However I get the following compile-time error :
The exception NotFoundException is already caught by the alternative WebApplicationException
But why is that? NotFoundException is supposed to come from a totally different package (jersey), isn't it ?
Also - it works fine if i put them in separate catch() blocks.
Please help.