projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- methods that return an object should throw an exception on failure (tm)
[m6w6/ext-http]
/
http_message_object.c
diff --git
a/http_message_object.c
b/http_message_object.c
index 4cb201a2e6f21093403b525301c5d36fbc675a2e..c0f5bf006118626abe6577acf8a6b97bf8f46565 100644
(file)
--- a/
http_message_object.c
+++ b/
http_message_object.c
@@
-1127,20
+1127,22
@@
PHP_METHOD(HttpMessage, setHttpVersion)
* Get parent Message.
*
* Returns the parent HttpMessage on success, or NULL if there's none.
* Get parent Message.
*
* Returns the parent HttpMessage on success, or NULL if there's none.
+ *
+ * Throws HttpMessageException.
*/
PHP_METHOD(HttpMessage, getParentMessage)
{
*/
PHP_METHOD(HttpMessage, getParentMessage)
{
- NO_ARGS;
-
- IF_RETVAL_USED {
+ SET_EH_THROW_HTTP();
+ NO_ARGS {
getObject(http_message_object, obj);
if (obj->message->parent) {
RETVAL_OBJVAL(obj->parent, 1);
} else {
getObject(http_message_object, obj);
if (obj->message->parent) {
RETVAL_OBJVAL(obj->parent, 1);
} else {
-
RETVAL_NULL(
);
+
http_error(HE_WARNING, HTTP_E_MESSAGE, "HttpMessage does not have a parent message"
);
}
}
}
}
+ SET_EH_NORMAL();
}
/* }}} */
}
/* }}} */