From 544a736f66837a705f63f8b4adfa7de33217bb26 Mon Sep 17 00:00:00 2001 From: ThisBirchWood Date: Tue, 3 Jun 2025 09:58:31 +0200 Subject: [PATCH] REFACTOR error handling --- .../java/com/ddf/vodsystem/services/MetadataService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ddf/vodsystem/services/MetadataService.java b/src/main/java/com/ddf/vodsystem/services/MetadataService.java index 9006c15..7c9bf8e 100644 --- a/src/main/java/com/ddf/vodsystem/services/MetadataService.java +++ b/src/main/java/com/ddf/vodsystem/services/MetadataService.java @@ -40,12 +40,14 @@ public class MetadataService { process = pb.start(); handleFfprobeError(process); logger.info("Metadata for file {} finished with exit code {}", file.getAbsolutePath(), process.exitValue()); + process.destroy(); return parseVideoMetadata(readStandardOutput(process)); - } catch (IOException | InterruptedException e) { + } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new FFMPEGException(e.getMessage()); + } catch (IOException e) { + throw new FFMPEGException(e.getMessage()); } - } public VideoMetadata getInputFileMetadata(String uuid) {