[ 
https://issues.apache.org/jira/browse/GEOMETRY-8?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16614355#comment-16614355
 ] 

Matt Juntunen commented on GEOMETRY-8:
--------------------------------------

[~erans], I'm interested to see what you think on this one. I ended up using a 
combination of JDK exception types for input validation and general illegal 
states and a specialized GeometryException hierarchy like we talked about for 
geometry-specific situations. I'm picturing the GeometryException being used in 
a similar way to ArithmeticException, ie, it is thrown when something 
mathematical ends up not working. So, we throw instances of this type when we 
encounter zero norms and other situations like angle set singularities. It 
didn't feel right to me to create a whole set of exception types for handling 
simple input validation (like commons-math does with 
MathIllegalArgumentException).

 

I also extended the checks for vector normalization to include NaN and 
infinite, hence the exception name of IllegalNormException and not 
ZeroNormException.

> Update Exception Instantiation
> ------------------------------
>
>                 Key: GEOMETRY-8
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-8
>             Project: Apache Commons Geometry
>          Issue Type: Task
>            Reporter: Matt Juntunen
>            Priority: Major
>
> Update exception instantiation following the pattern in commons-numbers, eg. 
> custom private exception types created through factories. See the discussion 
> on GEOMETRY-2 and the GammaException class and its use in LogBeta in 
> commons-numbers. 
>  
> Based on discussion in GEOMETRY-9, we are going to implement our own 
> exception hierarchy for this component, eg GeometryException and subclasses.
>  
> Pull request: [https://github.com/apache/commons-geometry/pull/9]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to