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: validate hostname and improve errors #59

Merged
merged 7 commits into from
Sep 6, 2023
Merged

fix: validate hostname and improve errors #59

merged 7 commits into from
Sep 6, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Sep 6, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Resolves #58

  • Validate hostname (usually coming from a misconfigured environment) and throw an explicit error (to be improved as a soft error in Auto host fallbackΒ #57)
  • Use better warnings including tried host and port(s)

New errors:

  • GetPortError: Invalid host: "http://localhost:8080"
  • GetPortError: Unable to find any random port on host "192.168.1.999"
  • GetPortError: Unable to find any available port on host "192.168.1.999" (tried 3000 and 3000-3100)

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Merging #59 (ad58820) into main (8d48ec6) will increase coverage by 1.75%.
The diff coverage is 84.78%.

❗ Current head ad58820 differs from pull request most recent head f025e58. Consider uploading reports for the commit f025e58 to get more accurate results

@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
+ Coverage   84.63%   86.39%   +1.75%     
==========================================
  Files           2        2              
  Lines         319      338      +19     
  Branches       47       55       +8     
==========================================
+ Hits          270      292      +22     
+ Misses         49       46       -3     
Files Changed Coverage Ξ”
src/index.ts 81.30% <84.78%> (+2.88%) ⬆️

@pi0 pi0 merged commit 836ca3c into main Sep 6, 2023
1 check failed
@pi0 pi0 deleted the fix/port-error branch September 6, 2023 17:04
@pi0 pi0 mentioned this pull request Sep 6, 2023
8 tasks
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.

Improve Unable to obtain an available random port number error with host
1 participant