- use exceptions where methods should return an object
if (obj->message->parent) {
RETVAL_OBJVAL(obj->parent, 1);
} else {
if (obj->message->parent) {
RETVAL_OBJVAL(obj->parent, 1);
} else {
- http_error(HE_WARNING, HTTP_E_MESSAGE, "HttpMessage does not have a parent message");
+ http_error(HE_WARNING, HTTP_E_RUNTIME, "HttpMessage does not have a parent message");
* to access the data of previously received responses within this request
* cycle.
*
* to access the data of previously received responses within this request
* cycle.
*
- * Throws HttpException.
+ * Throws HttpException, HttpRuntimeException.
*/
PHP_METHOD(HttpRequest, getResponseMessage)
{
*/
PHP_METHOD(HttpRequest, getResponseMessage)
{
- NO_ARGS;
-
- IF_RETVAL_USED {
zval *message;
SET_EH_THROW_HTTP();
zval *message;
SET_EH_THROW_HTTP();
if (Z_TYPE_P(message) == IS_OBJECT) {
RETVAL_OBJECT(message, 1);
} else {
if (Z_TYPE_P(message) == IS_OBJECT) {
RETVAL_OBJECT(message, 1);
} else {
+ http_error(HE_WARNING, HTTP_E_RUNTIME, "HttpRequest does not contain a response message");
* Get sent HTTP message.
*
* Returns an HttpMessage in a form of a string
* Get sent HTTP message.
*
* Returns an HttpMessage in a form of a string
*/
PHP_METHOD(HttpRequest, getRawRequestMessage)
{
*/
PHP_METHOD(HttpRequest, getRawRequestMessage)
{
* Get the entire HTTP response.
*
* Returns the complete web server response, including the headers in a form of a string.
* Get the entire HTTP response.
*
* Returns the complete web server response, including the headers in a form of a string.
*/
PHP_METHOD(HttpRequest, getRawResponseMessage)
{
*/
PHP_METHOD(HttpRequest, getRawResponseMessage)
{