mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-25 19:52:44 +01:00
improve error message on startup #1114
This commit is contained in:
parent
32ec2ea290
commit
36f34aff60
20
src/App.jsx
20
src/App.jsx
@ -56,6 +56,7 @@ import {
|
||||
extractStreams, runStartupCheck, setCustomFfPath as ffmpegSetCustomFfPath,
|
||||
isIphoneHevc, tryMapChaptersToEdl, blackDetect,
|
||||
getDuration, getTimecodeFromStreams, createChaptersFromSegments, extractSubtitleTrack,
|
||||
getFfmpegPath,
|
||||
} from './ffmpeg';
|
||||
import { shouldCopyStreamByDefault, getAudioStreams, getRealVideoStreams, defaultProcessedCodecTypes, isAudioDefinitelyNotSupported, doesPlayerSupportFile } from './util/streams';
|
||||
import { exportEdlFile, readEdlFile, saveLlcProject, loadLlcProject, askForEdlImport } from './edlStore';
|
||||
@ -2272,7 +2273,24 @@ const App = memo(() => {
|
||||
|
||||
const haveCustomFfPath = !!customFfPath;
|
||||
useEffect(() => {
|
||||
if (!haveCustomFfPath) runStartupCheck().catch((err) => handleError('LosslessCut is installation is broken', err));
|
||||
if (!haveCustomFfPath) {
|
||||
(async () => {
|
||||
try {
|
||||
await runStartupCheck();
|
||||
} catch (err) {
|
||||
if (['EPERM', 'EACCES'].includes(err.code)) {
|
||||
toast.fire({
|
||||
timer: 30000,
|
||||
icon: 'error',
|
||||
title: 'Fatal: ffmpeg not accessible',
|
||||
text: `Got ${err.code}. This probably means that anti-virus is blocking execution of ffmpeg. Please make sure the following file exists and is executable:\n\n${getFfmpegPath()}\n\nSee this issue: https://github.com/mifi/lossless-cut/issues/1114`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
handleError('Fatal: ffmpeg non-functional', err);
|
||||
}
|
||||
})();
|
||||
}
|
||||
}, [haveCustomFfPath]);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -116,7 +116,7 @@ export function handleError(arg1, arg2) {
|
||||
toast.fire({
|
||||
icon: 'error',
|
||||
title: msg || i18n.t('An error has occurred.'),
|
||||
text: errorMsg ? errorMsg.substr(0, 300) : undefined,
|
||||
text: errorMsg ? errorMsg.substring(0, 300) : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user