Skip to content

Conversation

@jjw24
Copy link
Member

@jjw24 jjw24 commented Feb 21, 2025

Follows on from #3262, adding exception handling.

@gitstream-cm
Copy link

gitstream-cm bot commented Feb 21, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

@jjw24 jjw24 closed this Feb 21, 2025
@jjw24 jjw24 force-pushed the add_exception_handling_register_unregister_hotkey branch from deccf1a to 54a49d6 Compare February 21, 2025 10:14
@github-actions

This comment has been minimized.

@jjw24 jjw24 reopened this Feb 21, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 21, 2025

📝 Walkthrough

Walkthrough

This change improves the hotkey management system by introducing error handling and logging in the hotkey registration and removal processes. The modifications include wrapping the hotkey-related methods with try-catch blocks, logging exceptions, and providing user feedback when errors occur. Additionally, new methods supporting the ChefKeys library have been added, and a new language resource for failed hotkey unregistration has been introduced in the application’s language file.

Changes

File Change Summary
Flow.Launcher/Helper/HotKeyMapper.cs Added try-catch error handling and logging to SetHotkey, SetWithChefKeys, and RemoveHotkey methods; new methods OnToggleHotkeyWithChefKeys, SetWithChefKeys, and RemoveWithChefKeys were introduced.
Flow.Launcher/Languages/en.xaml Added a new string resource (unregisterHotkeyFailed) to provide user feedback when hotkey removal fails.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant HM as HotKeyMapper
    participant CK as ChefKeys Library
    participant Log as Logger
    participant UI as UI Display

    U->>HM: Request hotkey registration
    HM->>CK: Register hotkey with ChefKeys
    alt Registration successful
        CK-->>HM: Hotkey registered
        HM->>UI: Confirm registration
    else Exception occurs
        CK-->>HM: Exception thrown
        HM->>Log: Log error details
        HM->>UI: Display error message
    end
Loading
sequenceDiagram
    participant HM as HotKeyMapper
    participant CK as ChefKeys Library
    participant Log as Logger
    participant UI as UI

    HM->>HM: OnToggleHotkeyWithChefKeys() invoked
    alt Hotkey active
        HM->>HM: Call RemoveWithChefKeys
        HM->>CK: Unregister hotkey
        alt Removal successful
            CK-->>HM: Hotkey unregistered
            HM->>UI: Confirm removal
        else Exception occurs
            CK-->>HM: Exception thrown
            HM->>Log: Log error details
            HM->>UI: Display removal error
        end
    else
        HM->>HM: Call SetWithChefKeys
        HM->>CK: Register hotkey
        alt Registration successful
            CK-->>HM: Hotkey registered
            HM->>UI: Confirm registration
        else Exception occurs
            CK-->>HM: Exception thrown
            HM->>Log: Log error details
            HM->>UI: Display registration error
        end
    end
Loading

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • Garulf
  • Yusyuriv
  • VictoriousRaptor
  • deefrawley
  • Zeroto521
  • taooceros
  • Jack251970
  • z1nc0r3
  • cibere
  • onesounds

Poem

I'm a bunny with a code-loving heart,
Hopping through hotkeys, playing my part.
Errors caught neatly in a try-catch embrace,
Logging each twist in our digital space.
With carrots 🥕 and hops so bold,
I cheer for robust code in every fold!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between deccf1a and 110b41c.

📒 Files selected for processing (2)
  • Flow.Launcher/Helper/HotKeyMapper.cs (3 hunks)
  • Flow.Launcher/Languages/en.xaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • Flow.Launcher/Languages/en.xaml
  • Flow.Launcher/Helper/HotKeyMapper.cs
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: gitStream workflow automation
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@gitstream-cm
Copy link

gitstream-cm bot commented Feb 21, 2025

🥷 Code experts: Yusyuriv, onesounds

Yusyuriv, jjw24 have most 👩‍💻 activity in the files.
jjw24, Yusyuriv have most 🧠 knowledge in the files.

See details

Flow.Launcher/Helper/HotKeyMapper.cs

Activity based on git-commit:

Yusyuriv jjw24
FEB 39 additions & 0 deletions
JAN
DEC
NOV
OCT
SEP

Knowledge based on git-blame:
Yusyuriv: 46%
jjw24: 28%

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

Yusyuriv jjw24
FEB
JAN
DEC 2 additions & 0 deletions
NOV
OCT
SEP

Knowledge based on git-blame:
jjw24: 8%
Yusyuriv: 6%

To learn more about /:\ gitStream - Visit our Docs

@jjw24 jjw24 added the Dev branch only An issue or fix for the Dev branch build label Feb 21, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.

Actionable comments posted: 5

🧹 Nitpick comments (5)
Flow.Launcher/Helper/HotKeyMapper.cs (1)

66-90: Reduce code duplication in error handling.

The error handling code is duplicated between SetHotkey and SetWithChefKeys methods. Consider extracting the common error handling logic into a separate method.

+private static void LogHotkeyError(Exception e, string methodName, string hotkeyStr)
+{
+    Log.Error(
+        string.Format("|HotkeyMapper.{0}|Error registering hotkey {1}: {2} \nStackTrace:{3}",
+                      methodName,
+                      hotkeyStr,
+                      e.Message,
+                      e.StackTrace));
+    string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr);
+    string errorMsgTitle = InternationalizationManager.Instance.GetTranslation("MessageBoxTitle");
+    MessageBoxEx.Show(errorMsg, errorMsgTitle);
+}

 internal static void SetHotkey(HotkeyModel hotkey, EventHandler<HotkeyEventArgs> action)
 {
     string hotkeyStr = hotkey.ToString();
     try
     {
         if (hotkeyStr == "LWin" || hotkeyStr == "RWin")
         {
             SetWithChefKeys(hotkeyStr);
             return;
         }

         HotkeyManager.Current.AddOrReplace(hotkeyStr, hotkey.CharKey, hotkey.ModifierKeys, action);
     }
     catch (Exception e)
     {
-        Log.Error(
-            string.Format("|HotkeyMapper.SetHotkey|Error registering hotkey {2}: {0} \nStackTrace:{1}",
-                          e.Message,
-                          e.StackTrace,
-                          hotkeyStr));
-        string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr);
-        string errorMsgTitle = InternationalizationManager.Instance.GetTranslation("MessageBoxTitle");
-        MessageBoxEx.Show(errorMsg, errorMsgTitle);
+        LogHotkeyError(e, "SetHotkey", hotkeyStr);
     }
 }
Flow.Launcher/HotkeyControlDialog.xaml.cs (3)

37-37: Make isOpenFlowHotkey readonly and document temporary nature.

The field should be marked as readonly since it's only set in the constructor. Additionally, the TODO comment should be expanded to explain why this is temporary.

-private static bool isOpenFlowHotkey;
+/// <summary>
+/// Temporary flag to enforce changing only the open flow hotkey to Win.
+/// This will be removed by PR #3157 which implements a more permanent solution.
+/// </summary>
+private static readonly bool isOpenFlowHotkey;

// In constructor:
-// TODO: This is a temporary way to enforce changing only the open flow hotkey to Win, and will be removed by PR #3157
isOpenFlowHotkey = _hotkeySettings.RegisteredHotkeys
                    .Any(x => x.DescriptionResourceKey == "flowlauncherHotkey" 
                           && x.Hotkey.ToString() == hotkey);

Also applies to: 53-56


73-80: Extract and improve ChefKeys cleanup.

The ChefKeys cleanup code is duplicated and lacks error handling. Extract it to a separate method with proper error handling.

+private void CleanupChefKeys()
+{
+    try
+    {
+        ChefKeysManager.StartMenuEnableBlocking = false;
+        ChefKeysManager.Stop();
+    }
+    catch (Exception e)
+    {
+        Log.Error(
+            string.Format("|HotkeyControlDialog.CleanupChefKeys|Error: {0} \nStackTrace:{1}",
+                          e.Message,
+                          e.StackTrace));
+    }
+}

 private void Cancel(object sender, RoutedEventArgs routedEventArgs)
 {
-    ChefKeysManager.StartMenuEnableBlocking = false;
-    ChefKeysManager.Stop();
+    CleanupChefKeys();
     ResultType = EResultType.Cancel;
     Hide();
 }

 private void Save(object sender, RoutedEventArgs routedEventArgs)
 {
-    ChefKeysManager.StartMenuEnableBlocking = false;
-    ChefKeysManager.Stop();
+    CleanupChefKeys();
     // ... rest of the method
 }

Also applies to: 82-96


191-197: Document Windows key handling behavior.

The special case handling for Windows keys should be documented to explain the behavior and its temporary nature.

+/// <summary>
+/// Checks if a hotkey is available for use.
+/// </summary>
+/// <param name="hotkey">The hotkey to check.</param>
+/// <param name="validateKeyGesture">Whether to validate the key gesture.</param>
+/// <returns>True if the hotkey is available, false otherwise.</returns>
+/// <remarks>
+/// Temporarily allows Windows keys (LWin/RWin) for the open flow hotkey.
+/// This special case will be removed by PR #3157.
+/// </remarks>
 private static bool CheckHotkeyAvailability(HotkeyModel hotkey, bool validateKeyGesture)
 {
     if (isOpenFlowHotkey && (hotkey.ToString() == "LWin" || hotkey.ToString() == "RWin"))
         return true;

     return hotkey.Validate(validateKeyGesture) && HotKeyMapper.CheckAvailability(hotkey);
 }
Flow.Launcher/HotkeyControl.xaml.cs (1)

153-182: Extract hotkey constants and improve documentation.

The Windows key handling should be improved by:

  1. Extracting magic strings to constants
  2. Adding XML documentation
  3. Clarifying the temporary nature of the solution
+/// <summary>
+/// Constants for special hotkeys that require ChefKeys handling.
+/// </summary>
+private static class SpecialHotkeys
+{
+    public const string LeftWindows = "LWin";
+    public const string RightWindows = "RWin";
+}

+/// <summary>
+/// Sets a hotkey with optional validation.
+/// </summary>
+/// <param name="keyModel">The hotkey model to set.</param>
+/// <param name="triggerValidate">Whether to validate the hotkey.</param>
+/// <remarks>
+/// Temporarily allows Windows keys (LWin/RWin) without validation.
+/// This special case will be removed by PR #3157.
+/// </remarks>
 private void SetHotkey(HotkeyModel keyModel, bool triggerValidate = true)
 {
     if (triggerValidate)
     {
         bool hotkeyAvailable = false;
-        // TODO: This is a temporary way to enforce changing only the open flow hotkey to Win, and will be removed by PR #3157
-        if (keyModel.ToString() == "LWin" || keyModel.ToString() == "RWin")
+        string hotkeyStr = keyModel.ToString();
+        if (hotkeyStr == SpecialHotkeys.LeftWindows || hotkeyStr == SpecialHotkeys.RightWindows)
         {
             hotkeyAvailable = true;
         }
         else
         {
             hotkeyAvailable = CheckHotkeyAvailability(keyModel, ValidateKeyGesture);
         }
         // ... rest of the method
     }
 }
🛑 Comments failed to post (5)
Flow.Launcher/Helper/HotKeyMapper.cs (4)

35-39: 🛠️ Refactor suggestion

Add null check for _mainViewModel.

The method should validate that _mainViewModel is not null before accessing it to prevent potential NullReferenceException.

 internal static void OnToggleHotkeyWithChefKeys()
 {
+    if (_mainViewModel == null)
+        return;
+
     if (!_mainViewModel.ShouldIgnoreHotkeys())
         _mainViewModel.ToggleFlowLauncher();
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    internal static void OnToggleHotkeyWithChefKeys()
    {
        if (_mainViewModel == null)
            return;
    
        if (!_mainViewModel.ShouldIgnoreHotkeys())
            _mainViewModel.ToggleFlowLauncher();
    }

47-64: 🛠️ Refactor suggestion

Improve error handling in ChefKeys registration.

The current implementation has two issues:

  1. ChefKeysManager.Start() is called after registration, which could leave the system in an inconsistent state if Start() fails
  2. No cleanup is performed if registration fails
 private static void SetWithChefKeys(string hotkeyStr)
 {
     try
     {
+        ChefKeysManager.Start();
         ChefKeysManager.RegisterHotkey(hotkeyStr, hotkeyStr, OnToggleHotkeyWithChefKeys);
-        ChefKeysManager.Start();
     }
     catch (Exception e)
     {
+        try
+        {
+            ChefKeysManager.UnregisterHotkey(hotkeyStr);
+            ChefKeysManager.Stop();
+        }
+        catch (Exception cleanupEx)
+        {
+            Log.Error(
+                string.Format("|HotkeyMapper.SetWithChefKeys|Error during cleanup: {0} \nStackTrace:{1}",
+                              cleanupEx.Message,
+                              cleanupEx.StackTrace));
+        }
+
         Log.Error(
             string.Format("|HotkeyMapper.SetWithChefKeys|Error registering hotkey: {0} \nStackTrace:{1}",
                           e.Message,
                           e.StackTrace));
         string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr);
         string errorMsgTitle = InternationalizationManager.Instance.GetTranslation("MessageBoxTitle");
         MessageBoxEx.Show(errorMsg, errorMsgTitle);
     }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    private static void SetWithChefKeys(string hotkeyStr)
    {
        try
        {
            ChefKeysManager.Start();
            ChefKeysManager.RegisterHotkey(hotkeyStr, hotkeyStr, OnToggleHotkeyWithChefKeys);
        }
        catch (Exception e)
        {
            try
            {
                ChefKeysManager.UnregisterHotkey(hotkeyStr);
                ChefKeysManager.Stop();
            }
            catch (Exception cleanupEx)
            {
                Log.Error(
                    string.Format("|HotkeyMapper.SetWithChefKeys|Error during cleanup: {0} \nStackTrace:{1}",
                                  cleanupEx.Message,
                                  cleanupEx.StackTrace));
            }

            Log.Error(
                string.Format("|HotkeyMapper.SetWithChefKeys|Error registering hotkey: {0} \nStackTrace:{1}",
                              e.Message,
                              e.StackTrace));
            string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr);
            string errorMsgTitle = InternationalizationManager.Instance.GetTranslation("MessageBoxTitle");
            MessageBoxEx.Show(errorMsg, errorMsgTitle);
        }
    }

92-115: 🛠️ Refactor suggestion

Add null check for hotkeyStr parameter.

The method should validate that hotkeyStr is not null before using it to prevent potential NullReferenceException.

 internal static void RemoveHotkey(string hotkeyStr)
 {
+    if (string.IsNullOrEmpty(hotkeyStr))
+        return;
+
     try
     {
         if (hotkeyStr == "LWin" || hotkeyStr == "RWin")
         {
             RemoveWithChefKeys(hotkeyStr);
             return;
         }

-        if (!string.IsNullOrEmpty(hotkeyStr))
-            HotkeyManager.Current.Remove(hotkeyStr);
+        HotkeyManager.Current.Remove(hotkeyStr);
     }
     catch (Exception e)
     {
         Log.Error(
             string.Format("|HotkeyMapper.RemoveHotkey|Error removing hotkey: {0} \nStackTrace:{1}",
                           e.Message,
                           e.StackTrace));
         string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("unregisterHotkeyFailed"), hotkeyStr);
         string errorMsgTitle = InternationalizationManager.Instance.GetTranslation("MessageBoxTitle");
         MessageBoxEx.Show(errorMsg, errorMsgTitle);
     }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    internal static void RemoveHotkey(string hotkeyStr)
    {
        if (string.IsNullOrEmpty(hotkeyStr))
            return;
    
        try
        {
            if (hotkeyStr == "LWin" || hotkeyStr == "RWin")
            {
                RemoveWithChefKeys(hotkeyStr);
                return;
            }
    
            HotkeyManager.Current.Remove(hotkeyStr);
        }
        catch (Exception e)
        {
            Log.Error(
                string.Format("|HotkeyMapper.RemoveHotkey|Error removing hotkey: {0} \nStackTrace:{1}",
                              e.Message,
                              e.StackTrace));
            string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("unregisterHotkeyFailed"), hotkeyStr);
            string errorMsgTitle = InternationalizationManager.Instance.GetTranslation("MessageBoxTitle");
            MessageBoxEx.Show(errorMsg, errorMsgTitle);
        }
    }

117-121: 🛠️ Refactor suggestion

Add error handling for ChefKeys cleanup operations.

The method should handle potential exceptions from ChefKeys operations to ensure proper cleanup.

 private static void RemoveWithChefKeys(string hotkeyStr)
 {
-    ChefKeysManager.UnregisterHotkey(hotkeyStr);
-    ChefKeysManager.Stop();
+    try
+    {
+        ChefKeysManager.UnregisterHotkey(hotkeyStr);
+    }
+    catch (Exception e)
+    {
+        Log.Error(
+            string.Format("|HotkeyMapper.RemoveWithChefKeys|Error unregistering hotkey: {0} \nStackTrace:{1}",
+                          e.Message,
+                          e.StackTrace));
+        throw;
+    }
+    finally
+    {
+        try
+        {
+            ChefKeysManager.Stop();
+        }
+        catch (Exception e)
+        {
+            Log.Error(
+                string.Format("|HotkeyMapper.RemoveWithChefKeys|Error stopping ChefKeys: {0} \nStackTrace:{1}",
+                              e.Message,
+                              e.StackTrace));
+        }
+    }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    private static void RemoveWithChefKeys(string hotkeyStr)
    {
        try
        {
            ChefKeysManager.UnregisterHotkey(hotkeyStr);
        }
        catch (Exception e)
        {
            Log.Error(
                string.Format("|HotkeyMapper.RemoveWithChefKeys|Error unregistering hotkey: {0} \nStackTrace:{1}",
                              e.Message,
                              e.StackTrace));
            throw;
        }
        finally
        {
            try
            {
                ChefKeysManager.Stop();
            }
            catch (Exception e)
            {
                Log.Error(
                    string.Format("|HotkeyMapper.RemoveWithChefKeys|Error stopping ChefKeys: {0} \nStackTrace:{1}",
                                  e.Message,
                                  e.StackTrace));
            }
        }
    }
Flow.Launcher/HotkeyControlDialog.xaml.cs (1)

58-59: 🛠️ Refactor suggestion

Add error handling for ChefKeys initialization.

The ChefKeys setup operations should include error handling to provide user feedback if initialization fails.

-ChefKeysManager.StartMenuEnableBlocking = true;
-ChefKeysManager.Start();
+try
+{
+    ChefKeysManager.StartMenuEnableBlocking = true;
+    ChefKeysManager.Start();
+}
+catch (Exception e)
+{
+    Log.Error(
+        string.Format("|HotkeyControlDialog.ctor|Error initializing ChefKeys: {0} \nStackTrace:{1}",
+                      e.Message,
+                      e.StackTrace));
+    string errorMsg = InternationalizationManager.Instance.GetTranslation("MessageBoxTitle");
+    MessageBoxEx.Show("Failed to initialize hotkey manager. Some hotkeys may not work.", errorMsg);
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

        try
        {
            ChefKeysManager.StartMenuEnableBlocking = true;
            ChefKeysManager.Start();
        }
        catch (Exception e)
        {
            Log.Error(
                string.Format("|HotkeyControlDialog.ctor|Error initializing ChefKeys: {0} \nStackTrace:{1}",
                              e.Message,
                              e.StackTrace));
            string errorMsg = InternationalizationManager.Instance.GetTranslation("MessageBoxTitle");
            MessageBoxEx.Show("Failed to initialize hotkey manager. Some hotkeys may not work.", errorMsg);
        }

@github-actions

This comment has been minimized.

@github-actions
Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

❌ Errors Count
❌ forbidden-pattern 22
⚠️ ignored-expect-variant 1
⚠️ non-alpha-in-dictionary 19

See ❌ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@jjw24 jjw24 disabled auto-merge February 22, 2025 09:10
@jjw24 jjw24 enabled auto-merge (squash) February 22, 2025 09:12
@jjw24 jjw24 added this to the 1.20.0 milestone Feb 22, 2025
@jjw24 jjw24 merged commit 70396bc into dev Feb 22, 2025
20 checks passed
@jjw24 jjw24 deleted the add_exception_handling_register_unregister_hotkey branch February 22, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dev branch only An issue or fix for the Dev branch build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants