- fix build (unknown macro)
authorMichael Wallner <mike@php.net>
Sun, 5 Mar 2006 11:04:17 +0000 (11:04 +0000)
committerMichael Wallner <mike@php.net>
Sun, 5 Mar 2006 11:04:17 +0000 (11:04 +0000)
- use exceptions where methods should return an object

http_message_object.c
http_request_object.c

index c0f5bf006118626abe6577acf8a6b97bf8f46565..3d2e72714ba5e818b1426691c9fa984af69194e3 100644 (file)
@@ -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();
index 6dc29b8cf5175de8268b8592da71a2c991ca1367..7791d4c1c1fdf49bd532654b286b0a9d07d1653e 100644 (file)
@@ -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)
 {