markdown-link-check
markdown-link-check copied to clipboard
`result.statusCode: 0` being returned by many external links
I've recently started getting a result.statusCode: 0 returned when checking my markdown files.
'use strict';
/**
* @fileoverview This is a stub test to use the `markdown-link-check` library directly,
* to test whether the problem is truly with `markdown-link-check`,
* or the underlying `link-check` library
*/
const markdownLinkCheck = require('markdown-link-check');
markdownLinkCheck('[example](http://google.com)', function (err, results) {
if (err) {
console.error('Error', err);
return;
}
results.forEach(function (result) {
console.log('%s is %s', result.link, result.status, result.statusCode);
});
});
markdownLinkCheck('[example](https://dequeuniversity.com/screenreaders/voiceover-keyboard-shortcuts)', function (err, results) {
if (err) {
console.error('Error', err);
return;
}
results.forEach(function (result) {
console.log('%s is %s', result.link, result.status, result.statusCode);
});
});
// output:
// http://google.com is alive 200
// https://dequeuniversity.com/screenreaders/voiceover-keyboard-shortcuts is dead 0
Is this perhaps related to https://github.com/tcort/link-check/issues/47#issuecomment-847764254?
Hey @tcort! Do you think that it would be feasible to introduce a generic retry parameter? In coder/coder we can observe some transient network issues which could be fixed with a simple retry/backoff mechanism.
We also observe similar issues with status code 0 for some links, a manual retry to our GH action usually fix it, would prefer to have the markdown link checker make that retry.
https://developer.android.com/build/multidex#avoid as well