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 for (http://*:3000): Address already in use"
it changes all "Can't create listen socket:" messages to
"Can't create listen socket for ($listen_URL):"


Signed-off-by: Jose Luis Perez Diez <[email protected]>
  • Loading branch information
jluis committed Apr 8, 2016
1 parent cadad73 commit 335a5a0
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 335a5a0

Please sign in to comment.