mirror of
https://github.com/Nathanwoodburn/FireWallet.git
synced 2024-11-24 08:08:14 +11:00
batchForm.cs: Added try-catch block to handle file in use exceptions
- Added try-catch block to handle exceptions when importing batch - Displayed error message and notification form if an exception occurs
This commit is contained in:
parent
c3abd0b4de
commit
404a47ec79
@ -637,6 +637,8 @@ namespace FireWallet
|
||||
openFileDialog.Filter = "All Files|*.*";
|
||||
openFileDialog.Title = "Open Batch";
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamReader sr = new StreamReader(openFileDialog.FileName);
|
||||
string line;
|
||||
@ -718,6 +720,13 @@ namespace FireWallet
|
||||
}
|
||||
}
|
||||
sr.Dispose();
|
||||
} catch (Exception ex)
|
||||
{
|
||||
AddLog("Error importing batch: " + ex.Message);
|
||||
NotifyForm notifyForm = new NotifyForm("Error importing batch\nMake sure the file is in not in use");
|
||||
notifyForm.ShowDialog();
|
||||
notifyForm.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user