From fc720d489914964ae837d7acbcdf9dc74b5a0f29 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Sun, 5 Mar 2006 11:04:17 +0000 Subject: [PATCH] - fix build (unknown macro) - use exceptions where methods should return an object --- http_message_object.c | 2 +- http_request_object.c | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/http_message_object.c b/http_message_object.c index c0f5bf0..3d2e727 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -1139,7 +1139,7 @@ PHP_METHOD(HttpMessage, getParentMessage) 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"); } } SET_EH_NORMAL(); diff --git a/http_request_object.c b/http_request_object.c index 6dc29b8..7791d4c 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -1877,13 +1877,11 @@ PHP_METHOD(HttpRequest, getResponseInfo) * to access the data of previously received responses within this request * cycle. * - * Throws HttpException. + * Throws HttpException, HttpRuntimeException. */ PHP_METHOD(HttpRequest, getResponseMessage) { - NO_ARGS; - - IF_RETVAL_USED { + NO_ARGS { zval *message; SET_EH_THROW_HTTP(); @@ -1891,7 +1889,7 @@ PHP_METHOD(HttpRequest, getResponseMessage) if (Z_TYPE_P(message) == IS_OBJECT) { RETVAL_OBJECT(message, 1); } else { - RETVAL_NULL(); + http_error(HE_WARNING, HTTP_E_RUNTIME, "HttpRequest does not contain a response message"); } SET_EH_NORMAL(); } @@ -1938,7 +1936,6 @@ PHP_METHOD(HttpRequest, getRequestMessage) * Get sent HTTP message. * * Returns an HttpMessage in a form of a string - * */ PHP_METHOD(HttpRequest, getRawRequestMessage) { @@ -1957,7 +1954,6 @@ PHP_METHOD(HttpRequest, getRawRequestMessage) * Get the entire HTTP response. * * Returns the complete web server response, including the headers in a form of a string. - * */ PHP_METHOD(HttpRequest, getRawResponseMessage) { -- 2.30.2