diff options
Diffstat (limited to 'lib/redmine/scm/adapters/abstract_adapter.rb')
-rw-r--r-- | lib/redmine/scm/adapters/abstract_adapter.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb index 720a4e9d9..c93fc6350 100644 --- a/lib/redmine/scm/adapters/abstract_adapter.rb +++ b/lib/redmine/scm/adapters/abstract_adapter.rb @@ -112,9 +112,15 @@ module Redmine def shellout(cmd, &block) logger.debug "Shelling out: #{cmd}" if logger && logger.debug? - IO.popen(cmd, "r+") do |io| - io.close_write - block.call(io) if block_given? + begin + IO.popen(cmd, "r+") do |io| + io.close_write + block.call(io) if block_given? + end + rescue Errno::ENOENT => e + # The command failed, log it and re-raise + log.error("SCM command failed: #{cmd}\n with: #{e.message}") + raise CommandFailed end end end |