Hi,

I'm trying to implement error handling in a PHP client (through the PHP
SOLR Plugin), I'm doing so by making a missing field mandatory temporarily.
When the update is sent through without the field made mandatory I get a
response back with a status code of 0 which is great. In the situation
where the field is made mandatory I was hoping to get a status code of 40
or whatever and an error message like the message in the tomcat log below:
"missing required field: numberviewed". Instead I get an exception, which
has a message of "Bad Request" and thousands of lines of data with
everything except "missing required field: numberviewed". I was wondering
if there there is anything I'm missing, is there a way to get to that
message?

Also, I wouldn't have thought a missing field was a severe error but I was
wondering if there was any other tests I could put in to deliberately get
errors that would show up as error codes on the result rather than
exceptions.

Thanks in advance for any advice.

Cheers

SEVERE: org.apache.solr.common.SolrException: Document
[7ec0f68c-dacb-4c5f-9e6d-84914b134591] missing required field: numberviewed
    at
org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:336)
    at
org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:60)
    at
org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpdateProcessorFactory.java:115)
    at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:158)
    at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:79)
    at
org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:67)
    at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
    at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368)
    at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
    at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)

Reply via email to