improve error handling

pull/2119/head
Mikael Finstad 2024-09-26 13:45:47 +02:00
rodzic 9c733742a2
commit 7230dc549b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 25AB36E3E81CBC26
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -1449,11 +1449,11 @@ function App() {
const batchOpenSingleFile = useCallback(async (path: string) => { const batchOpenSingleFile = useCallback(async (path: string) => {
if (workingRef.current) return; if (workingRef.current) return;
if (filePath === path) return; if (filePath === path) return;
setWorking({ text: i18n.t('Loading file') });
try { try {
setWorking({ text: i18n.t('Loading file') }); await withErrorHandling(async () => {
await userOpenSingleFile({ path }); await userOpenSingleFile({ path });
} catch (err) { }, i18n.t('Failed to open file'));
handleError(err);
} finally { } finally {
setWorking(undefined); setWorking(undefined);
} }