Browse Source

Handle connection errors gracefully

master
Patrick Lühne 2 years ago
parent
commit
02e03156ab
Signed by: patrick GPG Key ID: 05F3611E97A70ABF
  1. 9
      github-fast-env.rb

9
github-fast-env.rb

@ -35,8 +35,6 @@ script_path = File.realpath(ARGV[0])
control_socket_path = "/tmp/github-fast-envd.sock"
$control_socket = UNIXSocket.new(control_socket_path)
$original_stdin = $stdin.dup
$original_stdout = $stdout.dup
$original_stderr = $stderr.dup
@ -47,6 +45,13 @@ def log(level, message)
end
end
begin
$control_socket = UNIXSocket.new(control_socket_path)
rescue StandardError => error
log "error", "could not connect to github-fast-envd socket"
exit 1
end
$remote_process_id = nil
Signal.trap("HUP") do

Loading…
Cancel
Save