forked from ircmaxell/php-compiler
-
Notifications
You must be signed in to change notification settings - Fork 1
Web: Map uncaught exceptions to HTTP 500 in serve driver #152
Copy link
Copy link
Closed
Labels
area:webWeb / CGI / superglobalsWeb / CGI / superglobalsenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-1:web-runtimePhase 1 – CGI/web runtimePhase 1 – CGI/web runtime
Description
Activity
Metadata
Metadata
Assignees
Labels
area:webWeb / CGI / superglobalsWeb / CGI / superglobalsenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-1:web-runtimePhase 1 – CGI/web runtimePhase 1 – CGI/web runtime
Category
runtime|stdlib(web)Problem
bin/serve.phpcatchesThrowablebut production apps need Zend-aligned HTTP 500 behavior: configurable debug vs generic body, no stack leak in prod, stderr logging always. Today behavior is minimal plain-text and not env-gated like php-src SAPI error display.php-src reference
main/main.c—display_errors,html_errorsINI interactionZend/zend_exceptions.c— uncaught exception string formattingsapi/apache2handler/sapi_apache2.c(andphp_cli.c) — SAPI output of fatal/uncaught errorsRepro (today)
Document actual status code + body before fix. After #195 lands, uncaught
Exceptionmust be catchable by serve wrapper.Target behavior
PHP_COMPILER_DEBUG=0Internal Server Error(no stack)PHP_COMPILER_DEBUG=1Scope (this repo)
bin/serve.php— map uncaughtThrowable/Exceptionto 500 responselib/Web/— shared helper if MiniWebApp reusesPHP_COMPILER_DEBUG=1(document in README dev section)error_log()/ stderr with full tracetest/real/ortest/unit/Web/ServeExceptionTest.phpDone when
phpc serve/bin/serve.phpExceptionobjects (string-throw path documented if still supported)./script/ci-fast.sh --filter ServeExceptiongreenVerification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter ServeException'Dependencies
Exception/ThrowableLinks