mirror of
https://github.com/Nathanwoodburn/FireWallet.git
synced 2024-11-10 09:18:15 +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.Filter = "All Files|*.*";
|
||||||
openFileDialog.Title = "Open Batch";
|
openFileDialog.Title = "Open Batch";
|
||||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
StreamReader sr = new StreamReader(openFileDialog.FileName);
|
StreamReader sr = new StreamReader(openFileDialog.FileName);
|
||||||
string line;
|
string line;
|
||||||
@ -718,6 +720,13 @@ namespace FireWallet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sr.Dispose();
|
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