Skip to content

Commit 4f208f7

Browse files
committed
Error handling on sign in
1 parent ae955d7 commit 4f208f7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

ResourceDownloader/Program.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ public static void Main(string[] args)
1616
string ecsId = Console.ReadLine();
1717
string password = ShellMethods.EnterPassword("EnterPassword:");
1818
var user = new SakaiUser(ecsId, password);
19-
user.LogIn();
19+
try
20+
{
21+
user.LogIn();
22+
}
23+
catch (Exception ex)
24+
{
25+
Console.WriteLine("Failed to sign in:\r\n" + ex.Message);
26+
return;
27+
}
2028

2129
// Get site list
2230
SakaiSiteCollection collection = user.GetSites();

0 commit comments

Comments
 (0)