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 satya swaroop <sa...@gmail.com> on 2010/12/23 12:30:54 UTC

error in html???

Hi All,

         I am able to get the response in the success case in json format by
stating wt=json in the query. But as in case if any errors i am geting in
html format.
 1) Is there any specified reason to get in html format??
  2)cant we get the error result in json format??

Regards,
satya

Re: error in html???

Posted by Markus Jelsma <ma...@openindex.io>.
These

HTTP Status 500 - null java.lang.NullPointerException at 
java.io.StringReader.<init>(StringReader.java:50) at 

are returned in HTML. I use Nginx to detect the HTTP error code and return a 
JSON encoded body with the appropriate content type. Maybe it could be done in 
the servlet container but i never tried.

> What html format? Solr responds in XML, not HTML. Any HTML
> has to be created somewhere in the chain. Your browser
> may not be set up to render XML, so you could be seeing problems
> because of that.
> 
> If hit is off-base, could you explain your issue in a bit more detail?
> 
> Best
> Erick
> 
> On Thu, Dec 23, 2010 at 6:30 AM, satya swaroop 
<sa...@gmail.com>wrote:
> > Hi All,
> > 
> >         I am able to get the response in the success case in json format
> >         by
> > 
> > stating wt=json in the query. But as in case if any errors i am geting in
> > html format.
> > 
> >  1) Is there any specified reason to get in html format??
> >  2)cant we get the error result in json format??
> > 
> > Regards,
> > satya

Re: error in html???

Posted by lee carroll <le...@googlemail.com>.
Hi Satya,

This is not a solr issue. In your client which makes the json request you
need to have some error checking so you catch the error.

Occasionally people have apache set up to return a 200 ok http response with
a custom page on http errors (often for spurious security considerations)
but this breaks REST like services which SOLR implements and IMO should not
be done.

Take a look at the response coming back from solr and make sure you are
getting the correct http header response 500 etc when your queries errors.
If you are, great stuff you can then check your json invocation
documentation and catch and deal with these http errors in the client. if
your getting a 200 response check your apache config

lee c

On 24 December 2010 05:18, satya swaroop <sa...@gmail.com> wrote:

> Hi Erick,
>           Every result comes in xml format. But when you get any errors
> like http 500 or http 400 like wise we will get in html format. My query is
> cant we make that html file into json or vice versa..
>
> Regards,
> satya
>

Re: error in html???

Posted by satya swaroop <sa...@gmail.com>.
Hi Erick,
           Every result comes in xml format. But when you get any errors
like http 500 or http 400 like wise we will get in html format. My query is
cant we make that html file into json or vice versa..

Regards,
satya

Re: error in html???

Posted by Erick Erickson <er...@gmail.com>.
What html format? Solr responds in XML, not HTML. Any HTML
has to be created somewhere in the chain. Your browser
may not be set up to render XML, so you could be seeing problems
because of that.

If hit is off-base, could you explain your issue in a bit more detail?

Best
Erick

On Thu, Dec 23, 2010 at 6:30 AM, satya swaroop <sa...@gmail.com>wrote:

> Hi All,
>
>         I am able to get the response in the success case in json format by
> stating wt=json in the query. But as in case if any errors i am geting in
> html format.
>  1) Is there any specified reason to get in html format??
>  2)cant we get the error result in json format??
>
> Regards,
> satya
>