Skip to content

Commit

Permalink
Rewrite Error message Address in use #485
Browse files Browse the repository at this point in the history
"Can't create listen socket: Address already in use" is rewriten as
"Can't create listen socket on port $port: Address already in use"

Signed-off-by: Jose Luis Perez Diez <[email protected]>
  • Loading branch information
jluis committed Apr 7, 2016
1 parent cadad73 commit a520cbd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Statocles/Command.pm
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ sub main {
}

# Using start() instead of run() so we can stop() inside the tests
$daemon->start;
eval {$daemon->start};
if ($@) {
my $port = $opt{port} ||$ENV{MOJO_LISTEN} || 3000;
$@ =~ s/socket:/socket on port $port:/;
die $@;
}

# Find the port we're listening on
my $id = $daemon->acceptors->[0];
Expand Down

0 comments on commit a520cbd

Please sign in to comment.