Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore: better logging for duplicate keyboard shortcuts (#5425)

Vikrant Gupta4d64f1dedecb
diff --git a/frontend/src/hooks/hotkeys/useKeyboardHotkeys.tsx b/frontend/src/hooks/hotkeys/useKeyboardHotkeys.tsx
index 68e1bc7ae4..12b70fa68e 100644
--- a/frontend/src/hooks/hotkeys/useKeyboardHotkeys.tsx
+++ b/frontend/src/hooks/hotkeys/useKeyboardHotkeys.tsx
@@ -90,8 +90,14 @@ function KeyboardHotkeysProvider({
(keyCombination: string, callback: () => void): void => {
if (!shortcuts.current[keyCombination]) {
shortcuts.current[keyCombination] = callback;
+ } else if (process.env.NODE_ENV === 'development') {
+ throw new Error(
+ `This shortcut is already present in current scope :- ${keyCombination}`,
+ );
} else {
- throw new Error('This shortcut is already present in current scope');
+ console.error(
+ `This shortcut is already present in current scope :- ${keyCombination}`,
+ );
}
},
[shortcuts],