From 7230dc549b5591b01b6a3c8c000f170675790a76 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Thu, 26 Sep 2024 13:45:47 +0200 Subject: [PATCH] improve error handling --- src/renderer/src/App.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 242eef33..1618502d 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -1449,11 +1449,11 @@ function App() { const batchOpenSingleFile = useCallback(async (path: string) => { if (workingRef.current) return; if (filePath === path) return; + setWorking({ text: i18n.t('Loading file') }); try { - setWorking({ text: i18n.t('Loading file') }); - await userOpenSingleFile({ path }); - } catch (err) { - handleError(err); + await withErrorHandling(async () => { + await userOpenSingleFile({ path }); + }, i18n.t('Failed to open file')); } finally { setWorking(undefined); }