Any reason why ErrorCode.code isn't public final?  It seems weird that we have
public void assertQEx(String message, SolrQueryRequest req, int code ) {

instead of
public void assertQEx(String message, SolrQueryRequest req, 
SolrException.ErrorCode ) {

So much easier to write:
assertQEx("Query should throw an exception due to incorrect dimensions", 
req("fl", "*,score", "q",
            "homed:[1 TO 2000]"), SolrException.ErrorCode.BAD_REQUEST);

than to write:
assertQEx("Query should throw an exception due to incorrect dimensions", 
req("fl", "*,score", "q",
            "homed:[1 TO 2000]"), 400);  //or whatever that code is

Also, if it is public final, there really isn't any harm in exposing it 
elsewhere.  However, it does seem weird that we have these codes, but they 
aren't logged either, AFAICT.

Finally, do we have a plan for how they should be used?  Can we add new values 
to them?  Do we document anywhere what they mean?

-Grant

Reply via email to