Skip to content

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

Merged
merged 6 commits into from
Nov 20, 2018
Merged

fix: support hostname #35

merged 6 commits into from
Nov 20, 2018

Conversation

chnliquan
Copy link
Contributor

support user hostname

if (err.code === 'EADDRNOTAVAIL') {
throw new Error('the ip that is not unkonwn on the machine');
} else {
return handleError();
Copy link
Member

Choose a reason for hiding this comment

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

handleError(err)

@fengmk2
Copy link
Member

fengmk2 commented Nov 20, 2018

缺少对应的单元测试

@codecov
Copy link

codecov bot commented Nov 20, 2018

Codecov Report

Merging #35 into master will decrease coverage by 0.18%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
lib/detect-port.js 92.42% <93.33%> (-0.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 671094f...53aeb7e. Read the comment docs.

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.

Copy link
Member

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

@fengmk2 fengmk2 merged commit a00357a into node-modules:master Nov 20, 2018
@fengmk2
Copy link
Member

fengmk2 commented Nov 20, 2018

1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants