handle error in Packaged program loading (#6674)

This commit is contained in:
Divyansh Srivastava
2020-09-17 16:17:02 -07:00
committed by GitHub
parent b3833fcf1a
commit 00187269de
2 changed files with 13 additions and 3 deletions

View File

@@ -49,9 +49,9 @@ namespace Microsoft.Plugin.Program.Programs
{
path = package.InstalledLocation.Path;
}
catch (Exception e) when (e is ArgumentException || e is FileNotFoundException)
catch (Exception e) when (e is ArgumentException || e is FileNotFoundException || e is DirectoryNotFoundException)
{
ProgramLogger.LogException($"PackageWrapper", "GetWrapperFromPackage", "package.InstalledLocation.Path", $"Exception {package.Id.Name}", e);
ProgramLogger.LogException($"PackageWrapper", "GetWrapperFromPackage", "Path could not be determined", $"Exception {package.Id.Name}", e);
return new PackageWrapper(
package.Id.Name,
package.Id.FullName,