From fd03dcc13908b67635854730a2c350caff4ca1bf Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 21 Nov 2016 18:42:31 +0100 Subject: [PATCH] Handle ENOENT for cut as well (windows) Also log stderr and stdout of ffmpeg on error --- src/renderer.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer.jsx b/src/renderer.jsx index 66bbec74..e2948440 100644 --- a/src/renderer.jsx +++ b/src/renderer.jsx @@ -191,7 +191,10 @@ class App extends React.Component { this.setState({ working: true }); return ffmpeg.cut(filePath, this.state.fileFormat, cutStartTime, cutEndTime) .catch((err) => { - if (err.code === 1) { + console.error('stdout:', err.stdout); + console.error('stderr:', err.stderr); + + if (err.code === 1 || err.code === 'ENOENT') { alert('Whoops! ffmpeg was unable to cut this video. It may be of an unknown format or codec combination'); return; }