From f91a0d27eba05ae0469a787ab2d694f82f87a1ed Mon Sep 17 00:00:00 2001 From: 0xboobface <0xboobface@gmail.com> Date: Sat, 21 Dec 2019 22:04:59 +0100 Subject: [PATCH] Improve exception handling Change exception handling so that failed post-processing causes the recording to have the state "failed" --- .../java/ctbrec/recorder/download/dash/DashDownload.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/ctbrec/recorder/download/dash/DashDownload.java b/common/src/main/java/ctbrec/recorder/download/dash/DashDownload.java index fc1530ee..b9686286 100644 --- a/common/src/main/java/ctbrec/recorder/download/dash/DashDownload.java +++ b/common/src/main/java/ctbrec/recorder/download/dash/DashDownload.java @@ -30,9 +30,9 @@ import org.slf4j.LoggerFactory; import ctbrec.Config; import ctbrec.Model; import ctbrec.Recording; +import ctbrec.Recording.State; import ctbrec.io.HttpClient; import ctbrec.recorder.download.Download; -import ctbrec.recorder.download.dash.FfmpegMuxer.ProcessExitedUncleanException; import ctbrec.recorder.download.dash.SegmentTimelineType.S; import okhttp3.Request; import okhttp3.Response; @@ -340,8 +340,9 @@ public class DashDownload implements Download { new FfmpegMuxer(dir, file); targetFile = file; recording.setPath(path.substring(0, path.length() - 5)); - } catch (ProcessExitedUncleanException | IOException e) { + } catch (IOException e) { LOG.error("Error while merging dash segments", e); + recording.setStatus(State.FAILED); } }