Java Custom exception throw behaves differently between different Projects
- by Pablo
I am attempting to call the following in my code:
public void checkParticleLightRestriction(Particle parent) throws LightException {
if ( parent == null ) {
throw new LightException("quantum-particle-restrict.23", this);
}
In one Project the exception is thrown and the effect is similar to calling "return" whereby I am returned back to the point immediately succeeding where this method was called.
However in another Project I get thrown completed out of the current package and to a point way prior to the point preceeding this method.
It likes instead of being kicked out of a bar I am being deported all the way out of the country.
My option are the wrap the throw in a try / catch but I am wondering why this difference in behaviour beween the 2 projects ?