Skip to content

Commit 010c59b

Browse files
committed
Catch errors from openSaveButton worker.
1 parent 7590847 commit 010c59b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

CP2077SaveEditor/Views/Form1.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,14 @@ private void openSaveButton_Click(object sender, EventArgs e)
528528
maxProgress = 0;
529529
currentNode = string.Empty;
530530

531+
if (e.Error != null)
532+
{
533+
File.WriteAllText("error.txt", e.Error.Message + Environment.NewLine + e.Error.StackTrace);
534+
MessageBox.Show("Failed to parse save file: " + e.Error.Message + " An error.txt file has been generated with additional information.");
535+
statusLabel.Text = "Load cancelled.";
536+
return;
537+
}
538+
531539
if (wrongDefaultInfo != null)
532540
{
533541
if (new WrongDefaultDialog(wrongDefaultInfo.ClassName, wrongDefaultInfo.PropertyName, wrongDefaultInfo.Value).ShowDialog() != DialogResult.OK)

0 commit comments

Comments
 (0)