Re: How to handle error in sapi

From: Date: Fri, 25 Nov 2016 07:17:30 +0000
Subject: Re: How to handle error in sapi
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-97169@lists.php.net to get a copy of this message
Hi Zheng 2016-11-25 6:40 GMT+01:00 Zheng Shao <axot@axot.org>: > I'm confused by how to handle an error inside php_apache_sapi_read_post, shoud I throw a > zend_throw_exception or use a global flag for error handling? php_apache_sapi_read_post() is invoked very early on (php_module_startup > sapi_activate > sapi_read_post_data), and therefore we are too early at initialization that you cannot really throw an exception to the user. What you can do however is to call php_apache_sapi_log_message() and try to log the error in the Apache error log instead, which seems more reasonable to me. -- regards, Kalle Sommer Nielsen kalle@php.net

« previous php.internals (#97169) next »