From 1435e97f245b7d65648bc6ca4b279b2f76222c43 Mon Sep 17 00:00:00 2001 From: Lakshya Kapoor <4314581+kapoorlakshya@users.noreply.github.com> Date: Mon, 8 Jul 2024 05:09:33 +0000 Subject: [PATCH] Improve start error message --- lib/screen-recorder/common.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/screen-recorder/common.rb b/lib/screen-recorder/common.rb index 5e10475..8d215dd 100644 --- a/lib/screen-recorder/common.rb +++ b/lib/screen-recorder/common.rb @@ -61,7 +61,10 @@ def start_ffmpeg process = execute_command(ffmpeg_command, options.log) sleep(1.5) # Takes ~1.5s to initialize ffmpeg # Check if it exited unexpectedly - raise FFMPEG::Error, "Failed to start ffmpeg. Reason: #{lines_from_log(:last, 2)}" if process.exited? + if process.exited? + raise FFMPEG::Error, + "Failed to start command: #{ffmpeg_command}.\nReason: #{lines_from_log(:last, 10)}" + end process end