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