Skip to content

Commit

Permalink
Improve start error message
Browse files Browse the repository at this point in the history
  • Loading branch information
kapoorlakshya committed Jul 8, 2024
1 parent 2c95970 commit 1435e97
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/screen-recorder/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1435e97

Please sign in to comment.