You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Elaine Li <el...@gmail.com> on 2009/10/21 22:33:25 UTC

response status: error 400

Hi,

I am using Javascript and JSON to submit the solr query. I want to get
the reponse status so if there is a 400 http error, i will issue an
error instead of doing nothing which is very confusing to the user.
Hope I can even grab the message body.

How do i do that?

Thanks.

Elaine

Re: response status: error 400

Posted by Chris Hostetter <ho...@fucit.org>.
: I am pretty sure the url is no problem. The query syntax has a
: problem, so it returns 400. I just want to grab that value.

When Solr encounters an error, it returns the status code and error 
message w/o specifying any sort of error page.  The servlet container 
(jetty, resin, tomcat, etc...) then decides how to format it.  So you 
could look into configureing a custom error page in your servlet container 
to generate it a format your client code can understand.

There is an open issue in Jira to make it possible for the response 
writers to format the errors, but it hasn't gotten a lot of attention over 
the years...

https://issues.apache.org/jira/browse/SOLR-141



-Hoss


Re: response status: error 400

Posted by Elaine Li <el...@gmail.com>.
Thanks.

I am pretty sure the url is no problem. The query syntax has a
problem, so it returns 400. I just want to grab that value.

On Thu, Oct 22, 2009 at 4:50 AM, James liu <li...@gmail.com> wrote:
> Are you sure the url is correct?
>
>
> --
> regards
> j.L ( I live in Shanghai, China)
>

Re: response status: error 400

Posted by James liu <li...@gmail.com>.
Are you sure the url is correct?


-- 
regards
j.L ( I live in Shanghai, China)