Rethrow the exception within the catch clause for the translation, rather than hackily setting optimizer to null
@@ -166,7 +166,7 @@ public class GradientOptimizer implements Optimizer {
);
} catch (NotStrictlyPositiveException e) {
translateNSPExceptionToIllegalArgException(e);
- optimizer = null;
+ throw e;
}
PointValuePair pointValuePair = optimizer.optimize(
