When this code raise NotFoundException
the exception of main block will be raised, but I would like to raise NotFoundException
, how can I manage it?
try {
if (x > y) {
throw new NotFoundException("entity is not found");
}
} catch (final Exception e) {
throw new InternalServerErrorException(e);
}