Created
January 31, 2019 13:06
-
-
Save MartinZikmund/f1644645ec590d65e009ac161f1559c1 to your computer and use it in GitHub Desktop.
Trying to access library with try...catch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async Task<StorageLibrary> TryAccessLibraryAsync(KnownLibraryId library) | |
{ | |
try | |
{ | |
return await StorageLibrary.GetLibraryAsync(library); | |
} | |
catch (UnauthorizedAccessException) | |
{ | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment