Skip to content

Conversation

@jiripolasek
Copy link
Collaborator

@jiripolasek jiripolasek commented Dec 7, 2025

Summary of the Pull Request

This PR adds three parts of the original big bad global error handler (error report builder, sanitization and internal tools UI).

Error Report Generation

  • ErrorReportBuilder: Produces a detailed, technical report with system context.
  • Comprehensive data: OS version, architecture, culture, app version, elevation status, etc.
  • Exception analysis: Coalesces nested exception messages and HRESULT details for clearer diagnostics.
Example

This is an error report generated by Windows Command Palette.
If you are seeing this, it means something went a little sideways in the app.
You can help us fix it by filing a report at https://aka.ms/powerToysReportBug.

(While you’re at it, give the details below a quick skim — just to make sure there’s nothing personal you’d prefer not to share. It’s rare, but sometimes little surprises sneak in.)

Summary:
Message: Test exception; thrown from the UI thread
Type: System.NotImplementedException
Source: Microsoft.CmdPal.UI
Time: 2025-08-25 18:54:44.3854569
HRESULT: 0x80004001 (-2147467263)
Context: MainThreadException

Application:
App version: 0.0.1.0
Is elevated: no

Environment:
OS version: Microsoft Windows 10.0.26120
OS architecture: X64
Runtime identifier: win-x64
Framework: .NET 9.0.8
Process architecture: X64
Culture: cs-CZ
UI culture: en-US

Stack Trace:
at Microsoft.CmdPal.UI.Settings.InternalPage.ThrowPlainMainThreadException_Click(Object sender, RoutedEventArgs e)
at WinRT._EventSource_global__Microsoft_UI_Xaml_RoutedEventHandler.EventState.b__1_0(Object sender, RoutedEventArgs e)
at ABI.Microsoft.UI.Xaml.RoutedEventHandler.Do_Abi_Invoke(IntPtr thisPtr, IntPtr sender, IntPtr e)

------------------ Full Exception Details ------------------
System.NotImplementedException: Test exception; thrown from the UI thread
at Microsoft.CmdPal.UI.Settings.InternalPage.ThrowPlainMainThreadException_Click(Object sender, RoutedEventArgs e)
at WinRT._EventSource_global__Microsoft_UI_Xaml_RoutedEventHandler.EventState.b__1_0(Object sender, RoutedEventArgs e)
at ABI.Microsoft.UI.Xaml.RoutedEventHandler.Do_Abi_Invoke(IntPtr thisPtr, IntPtr sender, IntPtr e)

============================================================

Real-world example: #41362

PII Sanitization Framework

  • ErrorReportSanitizer: Multi-layer sanitization pipeline for sensitive data.
  • Nine specialized rule providers:
    • PiiRuleProvider: Personally identifiable information (emails, phone numbers, SSNs).
    • ProfilePathAndUsernameRuleProvider: Windows user profiles and usernames.
    • NetworkRuleProvider: IP addresses, MAC addresses, network identifiers.
    • SecretKeyValueRulesProvider: API keys, tokens, passwords in key/value formats.
    • FilenameMaskRuleProvider: Sensitive file paths and extensions.
    • UrlRuleProvider: URLs and web addresses.
    • TokenRuleProvider: JWT and other auth tokens.
    • ConnectionStringRuleProvider: Database connection strings.
    • EnvironmentPropertiesRuleProvider: Environment variables and system properties.

Internals Tools Page

A page in settings available in non-CI-builds:

image

PR Checklist

  • Closes: #xxx
  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@jiripolasek jiripolasek added the Product-Command Palette Refers to the Command Palette utility label Dec 7, 2025
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

check-spelling found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

- Update label on the Internal page
- Use Launcher to open log file / logs folder as DevRibbon
- Use different icon for open logs folder card
- Add button to quickly open a configuration folder (LocalState)
- Block candidate pattern (\?:[^\)]+\|[^\)]+)
@jiripolasek jiripolasek marked this pull request as ready for review December 7, 2025 23:04
@jiripolasek
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@michaeljolley
Copy link
Contributor

Minor conflicts to resolve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Command Palette Refers to the Command Palette utility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants