[ 
https://issues.apache.org/jira/browse/LUCENE-5405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benson Margulies updated LUCENE-5405:
-------------------------------------

    Description: 
SOLR-5623 included some conversation about the dilemmas of exception management 
and reporting in the analysis chain. 

I've belatedly become educated about the infostream, and this situation is a 
job for it. The DocInverterPerField can note exceptions in the analysis chain, 
log out to the infostream, and then rethrow them as before. No wrapping, no 
muss, no fuss.

There are comments on this JIRA from a more complex prior idea that readers 
might want to ignore.


  was:
SOLR-5623 included some conversation about the dilemmas of exception management 
and reporting in the analysis chain. Here is a 5.0 proposal:

TokenStream.reset and TokenStream.incrementToken (and perhaps the rest) should 
have a new, checked, exception in their signatures: call it AnalysisError if 
you like. Unlike IOException, it will have a full set of constructors, 
including the constructors that can wrap a 'cause'. Its constructors will 
accept a field name.

TokenStream will have a fieldName field, accepted in a constructor argument. 
(OK, this might a bit authoritarian.)

TokenStream will have:

  protected void throwAnalysisException(String explanation, Throwable cause) {
    throw new AnalysisException(fieldName, explanation, cause);
  }

Implementors of analysis will be thus encouraged to write things like:

  try {
    doSomething();
  } catch (IOExceptionOrWhatever e) {
    throwAnalysisException("Some Explanation", e);
 }

Then, situations like Solr can diagnose the field name.

Note that no information is lost here, due to the use of exception wrapping.



> Exception strategy for analysis improved
> ----------------------------------------
>
>                 Key: LUCENE-5405
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5405
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Benson Margulies
>
> SOLR-5623 included some conversation about the dilemmas of exception 
> management and reporting in the analysis chain. 
> I've belatedly become educated about the infostream, and this situation is a 
> job for it. The DocInverterPerField can note exceptions in the analysis 
> chain, log out to the infostream, and then rethrow them as before. No 
> wrapping, no muss, no fuss.
> There are comments on this JIRA from a more complex prior idea that readers 
> might want to ignore.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to