$php_errormsg not populated
| From: | Ivan Ristic | Date: | Sun, 15 Dec 2002 03:17:55 +0000 |
| Subject: | $php_errormsg not populated | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-92479@lists.php.net to get a copy of this message | ||
I have noticed that $php_errormsg is not populated
for all types of errors. The code below is from main/main.c.
Do you think that we can safely switch places for parts one
and two? If we do $php_errormsg will be populated before
bailing out, and this inconsistency will be sorted.
-- pt 1 --
/* Bail out if we can't recover */
switch (type) {
case E_CORE_ERROR:
if(!module_initialized) {
/* bad error in module startup - no way we can live with this */
exit(-2);
}
/* no break - intentionally */
case E_ERROR:
/*case E_PARSE: the parser would return 1 (failure), we can bail out nicely */
case E_COMPILE_ERROR:
case E_USER_ERROR:
if (module_initialized) {
zend_bailout();
return;
}
break;
}
-- pt 2 ---
/* Log if necessary */
if (PG(track_errors) && EG(active_symbol_table)) {
pval *tmp;
ALLOC_ZVAL(tmp);
INIT_PZVAL(tmp);
Z_STRVAL_P(tmp) = (char *) estrndup(buffer, buffer_len);
Z_STRLEN_P(tmp) = buffer_len;
Z_TYPE_P(tmp) = IS_STRING;
zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, si
}
-----------
--
Ivan Ristic, http://www.webkreator.com