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

Robert Muir commented on LUCENE-4255:
-------------------------------------

Yes: I think the original solution was fine as an intermediate step.

But I think its better to do like this patch:
* init(args) <-- this is doing argument processing, if they are illegal, throw 
IllegalAgumentException :)
* inform(ResourceLoader) <-- this is loading resources, so I added throws 
IOException: don't wrap it, just throw it.
* create() <-- if there is some error here, its happening at runtime so it 
throws RuntimeException.

I think this at least makes logical sense: the latter case we should really try 
to harden these factories
against to detect earlier in init/inform (in other issues), because its 
expensive to the user to not know 
their configuration is wrong until indexing documents or processing queries.

So I think this patch is ready, unless you see any problems?
                
> clean up analysis factory exception handling
> --------------------------------------------
>
>                 Key: LUCENE-4255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4255
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>         Attachments: LUCENE-4255.patch
>
>
> I don't like wrapping everything in the InitializationException, or that 
> inform() gets a resourceloader (whose methods throw IOExceptions), but every 
> analysis factory that implements this then needs to wrap the IOExceptions as 
> something else.
> I think its way more intuitive to use IllegalArgumentException in init(args), 
> and change inform() to throw IOException.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to