lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] Updated: (SOLR-2003) report errors for wrongly-encoded files in ResourceLoader.getLines()
Date Fri, 16 Jul 2010 13:20:53 GMT


Robert Muir updated SOLR-2003:

    Attachment: SOLR-2003_friendly.patch

attached is an improvement to make the error more friendly. 
it wraps the low-level exception, but provides the filename and suggests it might be in the
wrong encoding

> report errors for wrongly-encoded files in ResourceLoader.getLines()
> --------------------------------------------------------------------
>                 Key: SOLR-2003
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: 3.1, 4.0
>         Attachments: SOLR-2003.patch, SOLR-2003_friendly.patch
> ResourceLoader is used to load things like stopwords and synonyms files, but it uses
the default 'Charset' argument for this.
> when you open an InputStream with a Charset, you get:
> {code}
> decoder = charset.newDecoder().onMalformedInput(
>     CodingErrorAction.REPLACE).onUnmappableCharacter(
>     CodingErrorAction.REPLACE);
> {code}
> For cases like malformed encoded stopwords and synonyms files, I think its more helpful
to use CodingErrorAction.REPORT than to silently replace with a replacement char. Then the
user gets an exception.
> See:

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message