Skip to content

Instantly share code, notes, and snippets.

@MartinZikmund
Created January 31, 2019 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinZikmund/f1644645ec590d65e009ac161f1559c1 to your computer and use it in GitHub Desktop.
Save MartinZikmund/f1644645ec590d65e009ac161f1559c1 to your computer and use it in GitHub Desktop.
Trying to access library with try...catch
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