feat: add copyable error reports to detailed exception pages#10220
feat: add copyable error reports to detailed exception pages#10220memleakd wants to merge 2 commits 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>
|
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. |
|
Right. It's safe in your dev environment. But this context will be shared with AI or third parties. I don't think we need 100% of the data in the response. Most of the errors are: syntax, connection, missing file.. The details of the application error depend on the developer. |
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
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: