Fix comments

This commit is contained in:
vanzue
2025-05-12 09:45:44 +08:00
parent 8700edc001
commit e14609cbca
6 changed files with 10 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using ManagedCommon;
@@ -48,7 +49,14 @@ internal sealed partial class AppCommand : InvokableCommand
// const ActivateOptions noFlags = ActivateOptions.None;
await Task.Run(() =>
{
Process.Start(new ProcessStartInfo(path) { UseShellExecute = true });
try
{
Process.Start(new ProcessStartInfo(path) { UseShellExecute = true });
}
catch (System.Exception ex)
{
Logger.LogError(ex.Message);
}
});
}

View File

@@ -5,7 +5,6 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ManagedCommon;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using Windows.Storage.Streams;

View File

@@ -52,7 +52,6 @@ public class PackageWrapper : IPackage
}
catch (Exception e) when (e is ArgumentException || e is FileNotFoundException || e is DirectoryNotFoundException)
{
Logger.LogError(e.Message);
return new PackageWrapper(
package.Id.Name,
package.Id.FullName,

View File

@@ -201,14 +201,12 @@ internal static class RegistryHelper
}
catch (Exception exception)
{
Logger.LogError(exception.Message);
list.Add(new RegistryEntry($"{parentKey.Name}\\{subKey}", exception));
}
}
}
catch (Exception ex)
{
Logger.LogError(ex.Message);
list.Add(new RegistryEntry(parentKey.Name, ex));
}

View File

@@ -141,7 +141,6 @@ internal static class ResultHelper
}
catch (Exception exception)
{
Logger.LogError(exception.Message);
var registryEntry = new RegistryEntry(key.Name, exception);
resultList.Add(new ListItem(new OpenKeyInEditorCommand(registryEntry))

View File

@@ -112,9 +112,9 @@ internal static class AvailableResultsList
}
catch (Exception ex)
{
Logger.LogError($"Unable to format date time with format: {value}. Error: {ex.Message}");
if (!containsCustomSyntax)
{
Logger.LogError($"Unable to format date time with format: {value}. Error: {ex.Message}");
throw;
}
else