Skip to content

Commit 62ba0d7

Browse files
author
root
committed
Get command output from exception when installing mirroring keys
1 parent 77bb34c commit 62ba0d7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: lib/redmine_git_hosting/config/mirroring.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,24 @@ def gitolite_ssh_public_key_dest_path
8080

8181
def install_private_key
8282
RedmineGitHosting::Commands.sudo_install_file(gitolite_ssh_private_key_content, gitolite_ssh_private_key_dest_path, '600')
83-
rescue
84-
logger.error('Failed to install Redmine Git Hosting mirroring SSH private key !')
83+
rescue RedmineGitHosting::Error::GitoliteCommandException => e
84+
logger.error("Failed to install Redmine Git Hosting mirroring SSH private key : #{e.output}")
8585
false
8686
end
8787

8888

8989
def install_public_key
9090
RedmineGitHosting::Commands.sudo_install_file(gitolite_ssh_public_key_content, gitolite_ssh_public_key_dest_path, '644')
91-
rescue
92-
logger.error('Failed to install Redmine Git Hosting mirroring SSH public key !')
91+
rescue RedmineGitHosting::Error::GitoliteCommandException => e
92+
logger.error("Failed to install Redmine Git Hosting mirroring SSH public key : #{e.output}")
9393
false
9494
end
9595

9696

9797
def install_mirroring_script
9898
RedmineGitHosting::Commands.sudo_install_file(mirroring_script_content, gitolite_mirroring_script, '700')
99-
rescue
100-
logger.error('Failed to install Redmine Git Hosting mirroring script !')
99+
rescue RedmineGitHosting::Error::GitoliteCommandException => e
100+
logger.error("Failed to install Redmine Git Hosting mirroring script : #{e.output}")
101101
false
102102
end
103103

0 commit comments

Comments
 (0)