I am working on developing some REST web services using the new Services 3.x framework. For testing, I am calling from a PHP script using curl. I am debugging (EclipsePDT and XDebug) and stepping through the code to figure out what's going on. What I'm finding is that while the REST server code and the services module has good error trapping and handling, the error messages aren't getting returned in the HTTP response.

My current error is one that causes services_error to be called on line 83 of RESTServer.inc with a message of 'Could not find the controller' and an error code of 404. An exception is thrown and caught on line 36 in rest_server.module. The handleException function adds this text to the HTTP response header on line 570 in RESTServer.inc.

When my call to curl_exec returns in my driver code, the response is "false". The http code retrieved using curl_getinfo is 404, but the string returned by curl_error is "The requested URL returned error: 404".

How do I get the original error text? There is no response output (and I do have the CURLOPT_RETURNTRANSFER option enabled). Is this an issue in the services module, or am I doing something wrong in my calling code?

Comments

kylebrowning’s picture

Status: Active » Closed (cannot reproduce)

Its in the header information.