rename<CrashInfo>: rename Models.Issue to Models.CrashInfo

This commit is contained in:
leo 2023-10-13 11:21:45 +08:00
parent 838e688a0c
commit 0966baa1d8
2 changed files with 7 additions and 7 deletions

View file

@ -39,8 +39,8 @@ namespace SourceGit {
protected override void OnStartup(StartupEventArgs e) {
base.OnStartup(e);
// 崩溃上报
AppDomain.CurrentDomain.UnhandledException += (_, ev) => Models.Issue.Create(ev.ExceptionObject as Exception);
// 崩溃文件生成
AppDomain.CurrentDomain.UnhandledException += (_, ev) => Models.CrashInfo.Create(ev.ExceptionObject as Exception);
// 创建必要目录
if (!Directory.Exists(Views.Controls.Avatar.CACHE_PATH)) {

View file

@ -8,17 +8,17 @@ namespace SourceGit.Models {
/// <summary>
/// 崩溃日志生成
/// </summary>
public class Issue {
public static void Create(System.Exception e) {
public class CrashInfo {
public static void Create(Exception e) {
var builder = new StringBuilder();
builder.Append("Crash: ");
builder.Append(e.Message);
builder.Append("\n\n");
builder.Append("----------------------------\n");
builder.Append($"Windows OS: {Environment.OSVersion}\n");
builder.Append($"Version: {Assembly.GetExecutingAssembly().GetName().Version}");
builder.Append($"Platform: {AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName}");
builder.Append($"Source: {e.Source}");
builder.Append($"Version: {Assembly.GetExecutingAssembly().GetName().Version}\n");
builder.Append($"Platform: {AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName}\n");
builder.Append($"Source: {e.Source}\n");
builder.Append($"---------------------------\n\n");
builder.Append(e.StackTrace);