Skip to content

Commit

Permalink
Applying same fix as in pnp/PnP-PowerShell#2852
Browse files Browse the repository at this point in the history
  • Loading branch information
KoenZomers committed Nov 16, 2020
1 parent 5b8bd5b commit 4629eb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Commands/Files/GetFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ protected override void ExecuteCmdlet()
ClientContext.Load(file, f => f.Author, f => f.Length, f => f.ModifiedBy, f => f.Name, f => f.TimeCreated, f => f.TimeLastModified, f => f.Title);
ClientContext.ExecuteQueryRetry();
}
catch (ServerException e) when (e.Message == "User cannot be found.")
catch (ServerException e)
{
// Assume the cause of the exception is that a principal cannot be found and try again without:
// Fallback in case the creator or person having last modified the file no longer exists in the environment such that the file can still be downloaded
ClientContext.Load(file, f => f.Length, f => f.Name, f => f.TimeCreated, f => f.TimeLastModified, f => f.Title);
ClientContext.ExecuteQueryRetry();
Expand Down

0 comments on commit 4629eb4

Please sign in to comment.