lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Maxwell (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (SOLR-1503) Solr throws 500 instead of 400 on some malformed requests
Date Sat, 10 Oct 2009 07:17:31 GMT

    [ https://issues.apache.org/jira/browse/SOLR-1503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12764312#action_12764312
] 

Kyle Maxwell edited comment on SOLR-1503 at 10/10/09 12:15 AM:
---------------------------------------------------------------

Patch below, as Jira file upload is not working for me:

src/java/org/apache/solr/handler/XMLLoader.java #70

replace

throw (IOException) new IOException(e.getMessage()).initCause(e); 

with

throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e.getMessage(), e);


      was (Author: fizx):
    Patch below, as Jira file upload is not working for me:

--- src/java/org/apache/solr/handler/XMLLoader.java	(revision 823788)
+++ src/java/org/apache/solr/handler/XMLLoader.java	(working copy)
@@ -70,7 +70,7 @@
     }
     catch (XMLStreamException e) {
       //Hmmm, not quite right
-      throw (IOException) new IOException(e.getMessage()).initCause(e);
+      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e.getMessage(), e);
     } finally {
       IOUtils.closeQuietly(reader);
     }

  
> Solr throws 500 instead of 400 on some malformed requests
> ---------------------------------------------------------
>
>                 Key: SOLR-1503
>                 URL: https://issues.apache.org/jira/browse/SOLR-1503
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.3
>            Reporter: Kyle Maxwell
>            Priority: Minor
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> If you submit a malformed xml document to update, Solr returns a 500 error.  Clients
often treat this as a failure in the server, but it's really a 400 invalid request.  Trivial
patch is attached, although there may be similar cases (i.e. malformed json) that are also
worth investigating.

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


Mime
View raw message