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

Providing invalid URLs as arguments causes unexpected behavior(s) #51

Closed
timmkrause opened this issue Jun 8, 2018 · 2 comments · Fixed by #54
Closed

Providing invalid URLs as arguments causes unexpected behavior(s) #51

timmkrause opened this issue Jun 8, 2018 · 2 comments · Fixed by #54

Comments

@timmkrause
Copy link

Regarding #40 I am currently performing some regression tests and I came across the following (just FYI, I'm already taking care of it):

URL with 404:

$ markdown-link-check https://github.com/tcort/markdown-link-check/blob/master/READMEeeeeeeee.md

FILE: https://github.com/tcort/markdown-link-check/blob/master/READMEeeeeeeee.md
No hyperlinks found!

URL with invalid domain:

$ markdown-link-check https://gitaaaaaaaaaaaaaaaahub.com/tcort/markdown-link-check/blob/master/READMEeeeeeeee.md
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND gitaaaaaaaaaaaaaaaahub.com gitaaaaaaaaaaaaaaaahub.com:443
    at errnoException (dns.js:50:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)

Solution for URL with 404:

$ node markdown-link-check https://github.com/tcort/markdown-link-check/blob/master/READMEeeeeeeee.md

ERROR: Received unsuccessful status code of 404!

Solution for URL with invalid domain:

$ node markdown-link-check https://gitaaaaaaaaaaaaaaaahub.com/tcort/markdown-link-check/blob/master/READMEeeeeeeee.md

ERROR: Something went wrong!
Error: getaddrinfo ENOTFOUND gitaaaaaaaaaaaaaaaahub.com gitaaaaaaaaaaaaaaaahub.com:443
    at errnoException (dns.js:50:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
@gaurav-nelson
Copy link
Contributor

This issue is also true for invalid filenames:

$ markdown-link-check READMEe.md -p
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open 'READMEe.md'

@gaurav-nelson
Copy link
Contributor

and directories:

$ node markdown-link-check test/
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: EISDIR: illegal operation on a directory, read

@tcort tcort closed this as completed in #54 Jul 26, 2018
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 a pull request may close this issue.

2 participants