Skip to content

Commit

Permalink
Handle login errors. Closes #127
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmelsayed committed May 17, 2017
1 parent 6c21431 commit bf6c156
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Azure.Functions.Cli/Actions/AzureActions/BaseAzureAction.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using Azure.Functions.Cli.Arm;
using Azure.Functions.Cli.Common;
using Azure.Functions.Cli.Interfaces;

namespace Azure.Functions.Cli.Actions.AzureActions
Expand All @@ -13,9 +15,16 @@ public BaseAzureAction(IArmManager armManager)
_armManager = armManager;
}

public Task Initialize()
public async Task Initialize()
{
return _armManager.Initialize();
try
{
await _armManager.Initialize();
}
catch (Exception e)
{
throw new CliException("Error during login to azure. Please verify your internet connection or try again later.", e);
}
}
}
}

0 comments on commit bf6c156

Please sign in to comment.