Skip to content

Conversation

@mjansenDatabay
Copy link
Contributor

@mjansenDatabay mjansenDatabay commented Oct 17, 2025

This commit improves the global error handling in error.php:

  1. Remove building a global template from tpl.main.html since it only contains one placeholder (see 2b8eafc) and provides no added value
  2. Ensure a proper HTTP 500 status code is sent for normal error handling
  3. Ensure a proper HTTP 500 status code is sent if an unexpected error occurs while rendering the error page
  4. Log errors to error_log with minimal user-facing output, including an incident ID, timestamp, and message

@mjansenDatabay mjansenDatabay added improvement php Pull requests that update Php code labels Oct 17, 2025
Copy link

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 improves error handling in the global error.php file by streamlining error page rendering and enhancing error reporting. The changes focus on removing unnecessary template complexity, ensuring proper HTTP status codes, and implementing comprehensive error logging.

  • Simplifies template handling by removing the global template wrapper and using only the error-specific template
  • Adds proper HTTP 500 status codes for both normal error display and fallback error handling
  • Implements structured error logging with incident IDs, timestamps, and detailed stack traces

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

This commit improves the global error handling in `error.php`:

1. Remove building a global template from `tpl.main.html` since it only
contains one  placeholder (see 2b8eafc)
and provides no added value
2. Ensure a proper HTTP 500 status code is sent for normal error handling
3. Ensure a proper HTTP 500 status code is sent if an unexpected error
occurs while rendering the error page
4. Log errors to `error_log` with minimal user-facing output, including
an incident ID, timestamp, and message
@mjansenDatabay mjansenDatabay force-pushed the improvement/10/errors-in-error-handler branch from ca3cebf to 8c91c9d Compare October 17, 2025 07:23
@mjansenDatabay mjansenDatabay merged commit 0582888 into ILIAS-eLearning:release_10 Nov 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants