Good programming practices tell that you should hide the internal state of your objects from invokers and, at least for me, that also includes Exceptions. You should see what is the meaning of that exception for you and return to the invokers of your class an Exception representing that meaning.
If the framework already offers an exception with that meaning, for example IllegalArgumentException, you should instanciate a new object, give it a string with a good description of what happened and encapsulate the ocurred exception, something along the lines of new IllegalArgumentException("The argument X is invalid because of ...", e);
If the framework doesn't has a good descriptive exception for your problem, you should create your own set of exceptions. I normally create a generic exception for that project/package (that will extend Exception or RuntimeException) and derivate exceptions from that.
For example, I recently created a generic repository project to be reused across our services and aplication modules to access the database. Since I wanted to abstract invokers from what I was using to access the DB, even from exceptions, I ended up creating some exceptions to encapsulate JPA Hibernate exceptions. I don't have the code here, but it was something similar to:
// implementation package
public abstract class GenericRepository<K, E extends<K>> implements IRepository<K, E>{
// constructors
public final void add(E entity){
// some code
try{
// code that can throw exceptions
} catch (EntityExistsException e) {
// some code
throw new EntityAlreadyExistsException(e);
} catch(RuntimeException e) {
// some code
throw new GenericRepositoryException("An unexpected exception occurred while manipulating the database", e);
}
}
// some other code
}
// exception package
public final class EntityAlreadyExistsException extends GenericRepositoryException{
public static final String GENERICMESSAGE = "The entity already exists on the table";
public EntityAlreadyExistsException(Throwable cause){
super(GENERICMESSAGE, cause);
}
// other constructors
}