Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a Meaningful error msg for control server port taken #3204

Merged
6 changes: 5 additions & 1 deletion lib/puma/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ def start_control
control = Puma::Server.new app, nil,
{ min_threads: 0, max_threads: 1, queue_requests: false, log_writer: @log_writer }

control.binder.parse [str], nil, 'Starting control server'
begin
control.binder.parse [str], nil, 'Starting control server'
rescue Errno::EADDRINUSE, Errno::EACCES => e
raise e, "Error: Control server address '#{str}' is already in use. Original error: #{e.message}"
end
nateberkopec marked this conversation as resolved.
Show resolved Hide resolved

control.run thread_name: 'ctl'
@control = control
Expand Down