Handle connection errors gracefully
This commit is contained in:
parent
51b81a7bf8
commit
02e03156ab
@ -35,8 +35,6 @@ script_path = File.realpath(ARGV[0])
|
|||||||
|
|
||||||
control_socket_path = "/tmp/github-fast-envd.sock"
|
control_socket_path = "/tmp/github-fast-envd.sock"
|
||||||
|
|
||||||
$control_socket = UNIXSocket.new(control_socket_path)
|
|
||||||
|
|
||||||
$original_stdin = $stdin.dup
|
$original_stdin = $stdin.dup
|
||||||
$original_stdout = $stdout.dup
|
$original_stdout = $stdout.dup
|
||||||
$original_stderr = $stderr.dup
|
$original_stderr = $stderr.dup
|
||||||
@ -47,6 +45,13 @@ def log(level, message)
|
|||||||
end
|
end
|
||||||
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
|
$remote_process_id = nil
|
||||||
|
|
||||||
Signal.trap("HUP") do
|
Signal.trap("HUP") do
|
||||||
|
Loading…
Reference in New Issue
Block a user