-
Notifications
You must be signed in to change notification settings - Fork 25
fix: support hostname #35
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
Conversation
lib/detect-port.js
Outdated
if (err.code === 'EADDRNOTAVAIL') { | ||
throw new Error('the ip that is not unkonwn on the machine'); | ||
} else { | ||
return handleError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handleError(err)
缺少对应的单元测试 |
Codecov Report
@@ Coverage Diff @@
## master #35 +/- ##
==========================================
- Coverage 92.72% 92.53% -0.19%
==========================================
Files 2 2
Lines 55 67 +12
==========================================
+ Hits 51 62 +11
- Misses 4 5 +1
Continue to review full report at Codecov.
|
lib/detect-port.js
Outdated
listen(port, hostname, (err, realPort) => { | ||
if (err) { | ||
if (err.code === 'EADDRNOTAVAIL') { | ||
throw new Error('the ip that is not unkonwn on the machine'); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return callback(new Error('the ip that is not unkonwn on the machine')) 应该是 callback 返回,而不是 throw error
1.3.0 |
support user hostname