Skip to content

Commit

Permalink
Gracefully handle NotImplementedException downloading miners
Browse files Browse the repository at this point in the history
  • Loading branch information
nwoolls committed May 2, 2015
1 parent cc73c8a commit 254b1a6
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions MultiMiner.UX/ViewModels/ApplicationViewModel.cs
Expand Up @@ -2259,13 +2259,28 @@ public void InstallBackendMinerLocally(MinerDescriptor miner)
{
string minerPath = System.IO.Path.Combine("Miners", minerName);
string destinationFolder = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, minerPath);
MinerInstaller.InstallMiner(UserAgent.AgentString, miner, destinationFolder);
//may have been installed via Remoting - dismiss notification
if (NotificationDismissed != null)
NotificationDismissed(this, new NotificationEventArgs
try
{
MinerInstaller.InstallMiner(UserAgent.AgentString, miner, destinationFolder);
//may have been installed via Remoting - dismiss notification
if (NotificationDismissed != null)
NotificationDismissed(this, new NotificationEventArgs
{
Id = BfgMinerNotificationId.ToString()
});
}
catch (NotImplementedException)
{
//don't crash on *nix when downloads get triggered
PostNotification("Auto installation not supported for your OS", () =>
{
Id = BfgMinerNotificationId.ToString()
});
MessageBoxShow(
String.Format("You must install {0} for your OS manually.", miner.Name),
"Not Implemented",
PromptButtons.OK,
PromptIcon.Warning);
}, NotificationKind.Warning);
}
}
finally
{
Expand Down

0 comments on commit 254b1a6

Please sign in to comment.