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

Elliotte Rusty Harold commented on VALIDATOR-497:
-------------------------------------------------

I'm pretty confident it should be an exception with multiple subtypes, not an 
enum.

I still think IllegalArgumentException doesn't fit here. I don't think a 
generic exception like VerifyException is a good idea. You want a specific 
exception for the specific case, hence IBANException. You should be able to 
distinguish this exception from others purely based on type to pick the right 
logic in the catch clause without hacks like checking exception messages. 

As to runtime vs checked, it's a little tricky (as it is for 
NumberFormatException). The question to ask is this: if the string is in the 
wrong format is that a programming bug or external input? If the former, then 
it should be a runtime exception. If the latter, it should be checked. 
Unfortunately that can depend on context. Sometimes the string might be 
external input. Sometimes it might be internal to the program so there' s no 
perfect answer here. Runtime I guess, but you could reasonably go either way. 

> Extends validation result of IBANValidator
> ------------------------------------------
>
>                 Key: VALIDATOR-497
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-497
>             Project: Commons Validator
>          Issue Type: New Feature
>            Reporter: Slawomir Jaranowski
>            Priority: Major
>             Fix For: 1.10.0
>
>
> Currently we have a method {{IBANValidator#isValid}} which return true or 
> false depends on validation result.
> But for false result we don't know a reason, which can be like unsupported 
> country, invalid pattern, invalid checksum and so on ...
> Proposition is to add next method which throw exception with more details 
> about reason of failed verification.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to