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

fix: Graceful error handling for port already in use #5554

Merged
merged 3 commits into from
Jul 21, 2023

Conversation

hnnasit
Copy link
Contributor

@hnnasit hnnasit commented Jul 18, 2023

Which issue(s) does this change fix?

#5346

Why is this change necessary?

When debugging port is provided as -d option and the port is already in use, sam cli throws a trace error.

How does it address the issue?

This PR handles the above exception gracefully with the following message Ports are not available: exposing port TCP 127.0.0.1:<port_num> -> 0.0.0.0:0: listen tcp 127.0.0.1:<port_num>: bind: address already in use.

What side effects does this change have?

N/A

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hnnasit hnnasit requested a review from a team as a code owner July 18, 2023 16:35
Copy link
Contributor

@mildaniel mildaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@mildaniel mildaniel added this pull request to the merge queue Jul 20, 2023
Merged via the queue into aws:develop with commit f04b336 Jul 21, 2023
75 checks passed
@hnnasit hnnasit deleted the sam-bug-5346 branch September 22, 2023 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants