pankajit / solr-php-client

Automatically exported from code.google.com/p/solr-php-client
Other
0 stars 1 forks source link

A "nameless" exception is thrown in Apache_Solr_Service.php #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

When a parse exception on SOLR happens the library throws a simple Exception. 
It would be better to throw a specific SOLR error like 
Apache_Solr_ParseException 
which then extends Exception. 

In an implementation it is then possible to do try { } 
catch(Apache_Solr_ParseException) { }  
that would be very usefull because now we cannot determine the difference 
between a general SOLR exception (eg. server is not running) or a parse error 
in the search query.

Original issue reported on code.google.com by leonrenk...@gmail.com on 3 May 2011 at 12:36

GoogleCodeExporter commented 9 years ago
I agree. Simple messages like "400 Status: Bad Request" are just not enough. 
I can't determine the exact problem in the application, so i resort to writing 
basic curl requests, just to get more verbose error report. Could someone 
please, take a look into this?

Original comment by borko.ra...@gmail.com on 4 May 2011 at 8:44

GoogleCodeExporter commented 9 years ago
Have you two been using current svn trunk?

The exception should now be of type Apache_Solr_HttpTransportException and you 
should have full access to the Apache_Solr_Response object (and its response 
body) from the exception. 

We moved away from generic exceptions in r28 and added the http transport stuff 
in r49

Current trunk is r60

If you could try out trunk and tell me if it meets your requirements that would 
be appreciated.

Original comment by donovan....@gmail.com on 4 May 2011 at 2:17

GoogleCodeExporter commented 9 years ago
ow, darn.. did not see that. I only checked the current release. 

For me this solution is perfect, this fixes exactly my point :) 

Original comment by leonrenk...@gmail.com on 4 May 2011 at 2:21

GoogleCodeExporter commented 9 years ago
I've created  r60 download packages to make current code simpler to get for 
most people.

I'm going to close this issue as done, but feel free to open a new issue if 
there's still something missing that you need.

Original comment by donovan....@gmail.com on 4 May 2011 at 3:11