X Tutup
Skip to content

port: improve error-handling if port not found#10039

Merged
milas merged 2 commits intodocker:v2from
milas:port-not-found
Dec 5, 2022
Merged

port: improve error-handling if port not found#10039
milas merged 2 commits intodocker:v2from
milas:port-not-found

Conversation

@milas
Copy link
Contributor

@milas milas commented Dec 2, 2022

What I did
This method looked slightly incomplete. If the port wasn't found, it'd return err, but that was always nil, so we'd print out :0.

Now, we construct a nice error message with the targeted port and the ones we found.

The --protocol flag is also now case-insensitive to prevent any weirdness/confusion there.

Related issue
Fixes #10010.

(not mandatory) A picture of a cute animal, if possible in relation to what you did
a black cat with very large pupils

@milas milas added the area/cli label Dec 2, 2022
@milas milas requested a review from a team December 2, 2022 20:28
@milas milas self-assigned this Dec 2, 2022
@milas milas requested review from StefanScherer, glours, laurazard, ndeloof, nicksieger and ulyssessouza and removed request for a team December 2, 2022 20:29
This method looked slightly incomplete. If the port wasn't found,
it'd return `err`, but that was always `nil`, so we'd print out
`:0`.

Now, we construct a nice error message with the targeted port and
the ones we found.

The `--protocol` flag is also now case-insensitive to prevent any
weirdness/confusion there.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
Co-authored-by: Nick Sieger <nicksieger@gmail.com>
Signed-off-by: Milas Bowman <milasb@gmail.com>
@milas milas enabled auto-merge (squash) December 5, 2022 22:03
@milas milas merged commit 053f20e into docker:v2 Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] docker compose port app 80 returns :0

4 participants

X Tutup