Skip to content

Commit

Permalink
Crash dialog updates
Browse files Browse the repository at this point in the history
- Make crash dialog bigger

- Update crash reporting instructions
  • Loading branch information
Sparronator9999 committed Dec 4, 2024
1 parent a1c9411 commit 4becd25
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 35 deletions.
24 changes: 13 additions & 11 deletions YAMDCC.GUI/Dialogs/CrashDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions YAMDCC.GUI/Dialogs/CrashDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ namespace YAMDCC.GUI.Dialogs
{
internal sealed partial class CrashDialog : Form
{
public CrashDialog(Exception ex, bool threadException)
public CrashDialog(Exception ex)
{
InitializeComponent();
txtStackTrace.Text = threadException
? "(called from Application.ThreadException)\r\n"
: "(called from AppDomain.CurrentDomain.UnhandledException)\r\n";

txtStackTrace.Text += $"{ex.GetType()}: {ex.Message}\r\n{ex.StackTrace}";
txtStackTrace.Text = $"{ex.GetType()}: {ex.Message}\r\n{ex.StackTrace}";
}

private void btnReportIssue_Click(object sender, EventArgs e)
Expand Down
15 changes: 0 additions & 15 deletions YAMDCC.GUI/Dialogs/CrashDialog.resx
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,4 @@
<metadata name="grpReport.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="btnCopy.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="btnExit.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="lblError.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="btnIssues.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="grpReport.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
2 changes: 1 addition & 1 deletion YAMDCC.GUI/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ private void IPC_MessageReceived(object sender, PipeMessageEventArgs<ServiceResp

private void IPCClient_Error(object sender, PipeErrorEventArgs<ServiceResponse, ServiceCommand> e)
{
CrashDialog dlg = new(e.Exception, true);
CrashDialog dlg = new(e.Exception);
dlg.ShowDialog();
}

Expand Down
4 changes: 2 additions & 2 deletions YAMDCC.GUI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ private static void CurrentDomain_UnhandledException(object sender, UnhandledExc
{
if (e.ExceptionObject is Exception ex)
{
CrashDialog dlg = new(ex, false);
CrashDialog dlg = new(ex);
dlg.ShowDialog();
}
}

private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
CrashDialog dlg = new(e.Exception, true);
CrashDialog dlg = new(e.Exception);
dlg.ShowDialog();
}

Expand Down

0 comments on commit 4becd25

Please sign in to comment.