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

Gilles Sadowski commented on VALIDATOR-497:
-------------------------------------------

bq. Once you have a custom exception you can add state to it and catchers can 
can ask it questions.

Yes, that was the rationale for my advocating it many years ago in Commons Math 
(CM).  But eventually it was a failure because nobody ever needed to ask such 
questions:  In effect, in (almost) all CM code, once an exception is raised, 
the situation is non-recoverable (and, retrospectively, it was the caller's 
"mistake" (either a true bug, or some CM limitation) to have made that call.

Here, what are the "recoverable" situations?  *If they exist*, then a custom 
("self-documenting") exception is certainly better than having to parse the 
exception message.

> 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