public static RuntimeException handleException( final Exception e ) {
if ( EnvUtil.isPortableType( e.getClass() ) ) {
if ( e instanceof RuntimeException ) {
return (RuntimeException) e;
} else {
return new GenericPortableException( e.getMessage() );
}
}
return new GenericPortableException( e.getMessage() );
}