mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-05-29 16:49:36 +12:00
[BUG] Fix ArgumentException DirectoryNotFoundException (#198), version 1.0.19.1
This commit is contained in:
parent
e921e1dc7e
commit
bec9212d1b
|
@ -357,7 +357,7 @@ namespace SystemTrayMenu.Business
|
||||||
Log.Warn($"path:'{path}'", ex);
|
Log.Warn($"path:'{path}'", ex);
|
||||||
menuData.Validity = MenuDataValidity.NoAccess;
|
menuData.Validity = MenuDataValidity.NoAccess;
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Warn($"path:'{path}'", ex);
|
Log.Warn($"path:'{path}'", ex);
|
||||||
}
|
}
|
||||||
|
@ -410,7 +410,7 @@ namespace SystemTrayMenu.Business
|
||||||
Log.Warn($"path:'{path}'", ex);
|
Log.Warn($"path:'{path}'", ex);
|
||||||
menuData.Validity = MenuDataValidity.NoAccess;
|
menuData.Validity = MenuDataValidity.NoAccess;
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Warn($"path:'{path}'", ex);
|
Log.Warn($"path:'{path}'", ex);
|
||||||
}
|
}
|
||||||
|
@ -594,18 +594,7 @@ namespace SystemTrayMenu.Business
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (ex is SecurityException ||
|
Log.Warn($"fileName:'{fileName}'", ex);
|
||||||
ex is ArgumentException ||
|
|
||||||
ex is UnauthorizedAccessException ||
|
|
||||||
ex is PathTooLongException ||
|
|
||||||
ex is NotSupportedException)
|
|
||||||
{
|
|
||||||
Log.Warn($"fileName:'{fileName}'", ex);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rowData;
|
return rowData;
|
||||||
|
|
|
@ -118,11 +118,7 @@ namespace SystemTrayMenu
|
||||||
{
|
{
|
||||||
folderContainsFiles = Directory.GetFiles(path).Length > 0;
|
folderContainsFiles = Directory.GetFiles(path).Length > 0;
|
||||||
}
|
}
|
||||||
catch (UnauthorizedAccessException ex)
|
catch (Exception ex)
|
||||||
{
|
|
||||||
Log.Warn($"path:'{path}'", ex);
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
{
|
||||||
Log.Warn($"path:'{path}'", ex);
|
Log.Warn($"path:'{path}'", ex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,18 +156,7 @@ namespace SystemTrayMenu.DataClasses
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (ex is SecurityException ||
|
Log.Warn($"path:'{TargetFilePath}'", ex);
|
||||||
ex is ArgumentException ||
|
|
||||||
ex is UnauthorizedAccessException ||
|
|
||||||
ex is PathTooLongException ||
|
|
||||||
ex is NotSupportedException)
|
|
||||||
{
|
|
||||||
Log.Warn($"path:'{TargetFilePath}'", ex);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -388,21 +377,10 @@ namespace SystemTrayMenu.DataClasses
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (ex is SecurityException ||
|
Log.Warn(
|
||||||
ex is ArgumentException ||
|
$"path:'{TargetFilePath}', " +
|
||||||
ex is UnauthorizedAccessException ||
|
$"iconFile:'{iconFile}'",
|
||||||
ex is PathTooLongException ||
|
ex);
|
||||||
ex is NotSupportedException)
|
|
||||||
{
|
|
||||||
Log.Warn(
|
|
||||||
$"path:'{TargetFilePath}', " +
|
|
||||||
$"iconFile:'{iconFile}'",
|
|
||||||
ex);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SetText($"{FileInfo.Name[0..^4]}");
|
SetText($"{FileInfo.Name[0..^4]}");
|
||||||
|
@ -427,21 +405,10 @@ namespace SystemTrayMenu.DataClasses
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (ex is SecurityException ||
|
Log.Warn(
|
||||||
ex is ArgumentException ||
|
$"path:'{TargetFilePath}', " +
|
||||||
ex is UnauthorizedAccessException ||
|
$"executable:'{executable}'",
|
||||||
ex is PathTooLongException ||
|
ex);
|
||||||
ex is NotSupportedException)
|
|
||||||
{
|
|
||||||
Log.Warn(
|
|
||||||
$"path:'{TargetFilePath}', " +
|
|
||||||
$"executable:'{executable}'",
|
|
||||||
ex);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return handled;
|
return handled;
|
||||||
|
|
|
@ -411,16 +411,7 @@ namespace SystemTrayMenu.UserInterface
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (ex is SecurityException ||
|
Log.Warn($"KeyName:'{keyName}' SubKeyRef:'{subKeyRef}'", ex);
|
||||||
ex is UnauthorizedAccessException ||
|
|
||||||
ex is IOException)
|
|
||||||
{
|
|
||||||
Log.Warn($"KeyName:'{keyName}' SubKeyRef:'{subKeyRef}'", ex);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return strSysInfoPath;
|
return strSysInfoPath;
|
||||||
|
|
|
@ -115,15 +115,7 @@ namespace SystemTrayMenu.Utilities
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (ex is COMException ||
|
Log.Warn($"shortcutFilename:'{shortcutFilename}'", ex);
|
||||||
ex is UnauthorizedAccessException)
|
|
||||||
{
|
|
||||||
Log.Warn($"shortcutFilename:'{shortcutFilename}'", ex);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,16 +76,7 @@ namespace SystemTrayMenu.Utilities
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (ex is UnauthorizedAccessException ||
|
Log.Warn($"path:'{path}'", ex);
|
||||||
ex is IOException ||
|
|
||||||
ex is ArgumentException)
|
|
||||||
{
|
|
||||||
Log.Warn($"path:'{path}'", ex);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue