1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-21 18:02:35 +01:00

improve error handling

This commit is contained in:
Mikael Finstad 2024-09-26 13:45:47 +02:00
parent 9c733742a2
commit 7230dc549b
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

View File

@ -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);
}