File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,25 @@ const getChangelogFromFileSystem = async changelogUrl =>
35
35
* @param {string } changelogPath The given URL to the Node.js CHANGELOG.md file
36
36
*/
37
37
const createNodeReleases = changelogPath => {
38
- const changelogUrl = new URL ( changelogPath ) ;
38
+ /**
39
+ * @type {Promise<string> }
40
+ */
41
+ let changelogStrategy ;
42
+
43
+ try {
44
+ const changelogUrl = new URL ( changelogPath ) ;
45
+
46
+ changelogStrategy =
47
+ changelogUrl . protocol === 'file:'
48
+ ? getChangelogFromFileSystem ( changelogUrl )
49
+ : getChangelogFromNetwork ( changelogUrl ) ;
50
+ } catch ( err ) {
51
+ if ( err . code !== 'ERR_INVALID_URL' ) {
52
+ throw err ;
53
+ }
39
54
40
- const changelogStrategy =
41
- changelogUrl . protocol === 'file:'
42
- ? getChangelogFromFileSystem ( changelogUrl )
43
- : getChangelogFromNetwork ( changelogUrl ) ;
55
+ changelogStrategy = getChangelogFromFileSystem ( changelogPath ) ;
56
+ }
44
57
45
58
/**
46
59
* Retrieves all Node.js major versions from the provided CHANGELOG.md file
You can’t perform that action at this time.
0 commit comments