Skip to content

Conversation

@simonLeary42
Copy link
Collaborator

@simonLeary42 simonLeary42 commented Nov 13, 2025

also:

  • remove arrayGet function which is now redundant
  • display xdebug message in error page when display_errors and html_errors are enabled in PHP config
  • explicitly enable all xdebug features in dev environment
  • reorder message in error log so that less import information goes near the end
  • remove ini_set which never gets run because internalServerError never returns

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a custom error handler to convert PHP "Undefined array key" warnings into fatal exceptions by throwing ArrayKeyException. This ensures that array access errors are caught early and handled consistently with the existing arrayGet() utility function.

  • Added errorHandler() method to convert "Undefined array key" warnings to fatal exceptions
  • Enhanced xdebug configuration for better development debugging capabilities
  • Added configuration flag to enable/disable the error handler

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/docker-dev/web/Dockerfile Expanded xdebug modes to include develop, debug, gcstats, profile, and trace for enhanced debugging in development environment
resources/lib/UnityHTTPD.php Added new errorHandler() method to convert "Undefined array key" warnings to exceptions; added xdebug message display in error output; reordered errorLog method statements
resources/init.php Registered the new error handler when enabled via configuration
deployment/overrides/phpunit/config/config.ini Disabled error handler for PHPUnit tests to prevent interference with test execution
defaults/config.ini.default Added enable_error_handler configuration flag (enabled by default)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@simonLeary42 simonLeary42 merged commit 917f216 into main Dec 9, 2025
3 checks passed
@simonLeary42 simonLeary42 deleted the error-handler branch December 9, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants