fix: replace silent catch blocks with warnings
This commit is contained in:
@@ -423,7 +423,7 @@ function App() {
|
||||
const handleFocus = () => {
|
||||
invoke<DetectedRename[]>('detect_renames', { vaultPath: resolvedPath })
|
||||
.then(renames => { if (renames.length > 0) setDetectedRenames(renames) })
|
||||
.catch(() => {}) // ignore errors (e.g., no git)
|
||||
.catch((err) => console.warn('[vault] Git rename detection failed:', err))
|
||||
}
|
||||
window.addEventListener('focus', handleFocus)
|
||||
return () => window.removeEventListener('focus', handleFocus)
|
||||
@@ -556,7 +556,7 @@ function App() {
|
||||
if (!isTauri()) { document.title = title; return }
|
||||
import('@tauri-apps/api/window').then(({ getCurrentWindow }) => {
|
||||
getCurrentWindow().setTitle(title)
|
||||
}).catch(() => {})
|
||||
}).catch((err) => console.warn('[window] Failed to update note window title:', err))
|
||||
}, [noteWindowParams, notes.tabs, notes.activeTabPath])
|
||||
|
||||
// Keep note entry in sync with vault entries so banners (trash/archive)
|
||||
@@ -1034,7 +1034,7 @@ function App() {
|
||||
inspectorCollapsed: nextInspectorCollapsed,
|
||||
})
|
||||
|
||||
void applyMainWindowSizeConstraints(minWidth).catch(() => {})
|
||||
void applyMainWindowSizeConstraints(minWidth).catch((err) => console.warn('[window] Size constraints failed:', err))
|
||||
}, [layout.inspectorCollapsed, noteWindowParams])
|
||||
|
||||
const handleSetViewMode = useCallback((mode: ViewMode) => {
|
||||
|
||||
@@ -87,7 +87,7 @@ async function handleChipClick(
|
||||
return
|
||||
}
|
||||
|
||||
await openExternalUrl(chip.action.url).catch(() => {})
|
||||
await openExternalUrl(chip.action.url).catch((err) => console.warn('[link] Failed to open URL:', err))
|
||||
}
|
||||
|
||||
export function PropertyChips({
|
||||
|
||||
@@ -66,7 +66,7 @@ export function useEditorLinkActivation(
|
||||
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
openExternalUrl(urlTarget).catch(() => {})
|
||||
openExternalUrl(urlTarget).catch((err) => console.warn('[link] Failed to open URL:', err))
|
||||
}
|
||||
|
||||
container.addEventListener('click', handleClick, true)
|
||||
|
||||
@@ -125,7 +125,7 @@ export function useAutoGit({
|
||||
|
||||
void onCheckpoint(trigger).then((didRun) => {
|
||||
if (didRun) markTriggerAsHandled(lastTriggeredRef.current, trigger, lastActivityAt)
|
||||
}).catch(() => {})
|
||||
}).catch((err) => console.warn('[git] Auto-commit failed:', err))
|
||||
})
|
||||
|
||||
const updateAppActivity = useEffectEvent((active: boolean) => {
|
||||
|
||||
@@ -127,7 +127,7 @@ function useCommitInfoRefresher(
|
||||
return useCallback(() => {
|
||||
tauriCall<LastCommitInfo | null>('get_last_commit_info', { vaultPath })
|
||||
.then(info => setLastCommitInfo(info))
|
||||
.catch(() => {})
|
||||
.catch((err) => console.warn('[sync] Failed to refresh last commit info:', err))
|
||||
}, [vaultPath, setLastCommitInfo])
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ export function useMainWindowSizeConstraints({
|
||||
void (async () => {
|
||||
if (cancelled) return
|
||||
await applyMainWindowSizeConstraints(minWidth)
|
||||
})().catch(() => {})
|
||||
})().catch((err) => console.warn('[window] Size constraints failed:', err))
|
||||
|
||||
return () => {
|
||||
cancelled = true
|
||||
|
||||
@@ -54,7 +54,7 @@ function syncNativeMenuState(state: MenuStatePayload): void {
|
||||
|
||||
import('@tauri-apps/api/core')
|
||||
.then(({ invoke }) => invoke('update_menu_state', { state }))
|
||||
.catch(() => {})
|
||||
.catch((err) => console.warn('[menu] Failed to sync native menu state:', err))
|
||||
}
|
||||
|
||||
function useNativeMenuEventListener(handlersRef: { current: MenuEventHandlers }) {
|
||||
|
||||
@@ -26,7 +26,7 @@ function syncCrashReporting(
|
||||
if (!wasEnabled) return
|
||||
|
||||
teardownSentry()
|
||||
tauriCall('reinit_telemetry').catch(() => {})
|
||||
tauriCall('reinit_telemetry').catch((err) => console.warn('[telemetry] Reinit failed:', err))
|
||||
}
|
||||
|
||||
function syncAnalytics(
|
||||
|
||||
Reference in New Issue
Block a user