lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris A. Mattmann (JIRA)" <>
Subject [jira] Commented: (SOLR-1589) Make FieldType#toInternal throw explicit Exceptions when Field values don't validate
Date Mon, 23 Nov 2009 02:49:39 GMT


Chris A. Mattmann commented on SOLR-1589:

I'm looking to come up with a solution that covers both non-RPC interactions, as well as non-client/server,
framework-related interactions, regardless. I guess the whole idea is whether or not you are
in code:

//some SOLR class that deals with FieldTypes
// FieldType: myFieldType
  myFieldType.toInternal(//some string)
catch(InvalidFieldException e){

versus being in an RPC interaction:

curl $URL --data-binary @myFile.xml f -H 'Content-type:text/xml; charset=utf-8'
org.apache.solr.InvalidFieldException: Some brilliant message....
some stacktrace...

I think we should let the caller know it's a org.apache.solr.InvalidFieldException. That's
my whole point. So, +1 for that. SolrException is probably a good candidate either way, since
SolrException codes, whether sent across the wire, or used internally, should be _mapped_
to HttpResponse codes, and _not_ treated as equivalent, IMHO.

> Make FieldType#toInternal throw explicit Exceptions when Field values don't validate
> ------------------------------------------------------------------------------------
>                 Key: SOLR-1589
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: My MacBook pro laptop.
>            Reporter: Chris A. Mattmann
>            Priority: Minor
>             Fix For: 1.5
> As discussed on the mailing list: 
> I think we can do a better job of having explicit Exceptions when there is a problem
creating the internal representation of a Field, as defined by FieldType#toInternal. Instead
of throwing obscure RuntimeExceptions, let's create a FieldValidationException explicit type,
and make o.a.solr.schema.FieldType#toInternal throw this Exception as part of its signature.

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

View raw message