summaryrefslogtreecommitdiff
path: root/Zend/zend_list.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2005-06-17 11:25:31 +0000
committerAntony Dovgal <tony2001@php.net>2005-06-17 11:25:31 +0000
commitbaf8cadeff025342c00c4955811cc0f366ef70cf (patch)
tree7d4d41e35ff33a7313ad265822bd2df9aaf43ebc /Zend/zend_list.c
parent8d2dd7901c4432fbddc5bf4e8bf3c4962cdb2f0d (diff)
downloadphp-git-baf8cadeff025342c00c4955811cc0f366ef70cf.tar.gz
improve error messages when error raised from an internal class (do not hide class name)
Diffstat (limited to 'Zend/zend_list.c')
-rw-r--r--Zend/zend_list.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Zend/zend_list.c b/Zend/zend_list.c
index bd88e44c76..662a8661fb 100644
--- a/Zend/zend_list.c
+++ b/Zend/zend_list.c
@@ -114,16 +114,20 @@ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, c
void *resource;
va_list resource_types;
int i;
+ char *space;
+ char *class_name;
if (default_id==-1) { /* use id */
if (!passed_id) {
if (resource_type_name) {
- zend_error(E_WARNING, "%s(): no %s resource supplied", get_active_function_name(TSRMLS_C), resource_type_name);
+ class_name = get_active_class_name(&space TSRMLS_CC);
+ zend_error(E_WARNING, "%s%s%s(): no %s resource supplied", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name);
}
return NULL;
} else if ((*passed_id)->type != IS_RESOURCE) {
if (resource_type_name) {
- zend_error(E_WARNING, "%s(): supplied argument is not a valid %s resource", get_active_function_name(TSRMLS_C), resource_type_name);
+ class_name = get_active_class_name(&space TSRMLS_CC);
+ zend_error(E_WARNING, "%s%s%s(): supplied argument is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name);
}
return NULL;
}
@@ -135,7 +139,8 @@ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, c
resource = zend_list_find(id, &actual_resource_type);
if (!resource) {
if (resource_type_name) {
- zend_error(E_WARNING, "%s(): %d is not a valid %s resource", get_active_function_name(TSRMLS_C), id, resource_type_name);
+ class_name = get_active_class_name(&space TSRMLS_CC);
+ zend_error(E_WARNING, "%s%s%s(): %d is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), id, resource_type_name);
}
return NULL;
}
@@ -153,7 +158,8 @@ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, c
va_end(resource_types);
if (resource_type_name) {
- zend_error(E_WARNING, "%s(): supplied resource is not a valid %s resource", get_active_function_name(TSRMLS_C), resource_type_name);
+ class_name = get_active_class_name(&space TSRMLS_CC);
+ zend_error(E_WARNING, "%s%s%s(): supplied resource is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name);
}
return NULL;