Skip to content

Add possibility to report errors dirctly to GitHub#7

Merged
AenBleidd merged 2 commits into
masterfrom
vko_improve_debug_log
Aug 26, 2025
Merged

Add possibility to report errors dirctly to GitHub#7
AenBleidd merged 2 commits into
masterfrom
vko_improve_debug_log

Conversation

@AenBleidd

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
Copilot AI review requested due to automatic review settings August 26, 2025 00:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds functionality to automatically report errors to GitHub by generating pre-filled issue URLs and removes the manual debug logging toggle. Debug logging is now enabled by default to support better error reporting.

  • Debug logging is enabled by default and the manual toggle checkbox has been removed
  • Error reporting functionality added with automatic GitHub issue creation for various failure scenarios
  • Log file location changed from Documents to temp directory for easier access

Reviewed Changes

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

File Description
MainWindow.xaml.cs Adds PromptOpenIssue method and integrates error reporting calls throughout error handling paths
MainWindow.xaml Removes debug logging checkbox from UI
DebugLogger.cs Enables logging by default, moves log files to temp directory, and simplifies initialization

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

Comment thread MainWindow.xaml.cs Outdated
Comment thread MainWindow.xaml.cs
sb.AppendLine($"Log file path (attach this file in the issue): {DebugLogger.LogFilePath}");
}

var url = repoNewIssueUrl + "?title=" + Uri.EscapeDataString(title ?? "Installer error")

Copilot AI Aug 26, 2025

Copy link

Choose a reason for hiding this comment

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

Uri.EscapeDataString is the correct method to use, but the System.Web using statement should be removed since it's not needed and not available in WPF.

Copilot uses AI. Check for mistakes.
Comment thread MainWindow.xaml.cs
sb.AppendLine("Error context:");
sb.AppendLine(details ?? "(no details)");
sb.AppendLine();
sb.AppendLine($"App version: {FileVersionInfo.GetVersionInfo(Process.GetCurrentProcess().MainModule.FileName).FileVersion}");

Copilot AI Aug 26, 2025

Copy link

Choose a reason for hiding this comment

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

Process.GetCurrentProcess().MainModule can be null in certain scenarios, which would cause a NullReferenceException. Consider adding null checks or using Assembly.GetExecutingAssembly() instead.

Suggested change
sb.AppendLine($"App version: {FileVersionInfo.GetVersionInfo(Process.GetCurrentProcess().MainModule.FileName).FileVersion}");
sb.AppendLine($"App version: {FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion}");

Copilot uses AI. Check for mistakes.
Comment thread MainWindow.xaml.cs

if (ask == MessageBoxResult.Yes)
{
Process.Start(url);

Copilot AI Aug 26, 2025

Copy link

Choose a reason for hiding this comment

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

Starting a process with a user-constructed URL without validation could be a security risk. Consider validating the URL starts with the expected GitHub domain or use ProcessStartInfo with UseShellExecute = true.

Suggested change
Process.Start(url);
// Validate the URL starts with the expected GitHub domain
if (url.StartsWith("https://github.com/", StringComparison.OrdinalIgnoreCase))
{
var psi = new ProcessStartInfo
{
FileName = url,
UseShellExecute = true
};
Process.Start(psi);
}

Copilot uses AI. Check for mistakes.
Comment thread DebugLogger.cs
LogInfo("=" + new string('=', 70), "DebugLogger");
}
catch (Exception ex)
catch

Copilot AI Aug 26, 2025

Copy link

Choose a reason for hiding this comment

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

Using a bare catch block without specifying exception type is generally discouraged. Consider catching specific exception types or at minimum Exception to make the intent clearer.

Suggested change
catch
catch (Exception)

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@AenBleidd AenBleidd merged commit 90d5284 into master Aug 26, 2025
1 check passed
@AenBleidd AenBleidd deleted the vko_improve_debug_log branch August 26, 2025 00:16
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