feat: add copyable error reports to detailed exception pages#10220
Open
memleakd wants to merge 1 commit into
Open
feat: add copyable error reports to detailed exception pages#10220memleakd wants to merge 1 commit into
memleakd wants to merge 1 commit into
Conversation
Add a Copy Details action to detailed HTML exception pages. - Render a copyable Markdown error report from the error view - Include safe exception, environment, request, source, and stack trace context - Omit sensitive request data, query strings, cookies, body data, and trace args - Add tests for report rendering, escaping, previous exceptions, and privacy Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
neznaika0
suggested changes
May 20, 2026
| $reportTitle = $reportTitle === '' ? $title : explode("\n", $reportTitle, 2)[0]; | ||
| $messageLines = str_contains($reportMessage, "\n"); | ||
|
|
||
| $reportResponse = new Response(); |
Contributor
There was a problem hiding this comment.
Suggested change
| $reportResponse = new Response(); | |
| $reportResponse = service('response'); |
Response object can be redefined by custom
Contributor
|
Really nice change. It will be really useful while debugging. Just a thought. Maybe we could also supply which particular features are enabled/disabled. Like, CSRF enabled, CSP disabled, etc. so, in this way, we can debug more easily. Also, we could also add route details too, like what is alias for this route, which controller method it corresponds to, which filters ran for these routes. And since this error page is only visible in dev environment and not in production, we can assume that revealing filter information or controller method can't be risky. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR proposes adding a Copy Details button to CodeIgniter’s detailed HTML exception page.
The goal is to make debugging information easier to share from the local development error page. Instead of manually gathering the relevant debugging information, users can copy a Markdown-formatted report with one click and paste it into an issue, discussion, chat, LLM or anywhere else they need.
Copy.Details.mp4
The copied report includes the most useful debugging context:
The report intentionally avoids riskful or sensitive request data. It does NOT include headers, cookies, query strings, request body data, session data, route params, database queries, or trace arguments.
Implementation wise, the Markdown report is rendered by a small
error_report.phppartial used by the detailed HTML error view. The button uses the Clipboard API when available and falls back to a textarea-based copy path when needed.Tests cover rendering the button, escaping the hidden report content, including previous exceptions, and omitting sensitive request data, trace arguments, and query strings from copied output.
Checklist: