Skip to content

Commit

Permalink
Merge pull request #275 from aki77/dev
Browse files Browse the repository at this point in the history
fix: error handling in rubyGemsChangeLogUrl function
  • Loading branch information
kzkn authored Aug 26, 2024
2 parents 9af3ec6 + 18d6e41 commit 195ad4c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
19 changes: 15 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,20 @@ async function rubyGemsChangeLogUrl(
gem: Gem,
option?: {token: string}
): Promise<GemWithChangeLogUrl> {
let [found, changeLogUrl] = await findChangeLogUrlFromCache(gem) // eslint-disable-line prefer-const
if (!found) {
changeLogUrl = await searchChangeLogUrl(gem, option)
try {
let [found, changeLogUrl] = await findChangeLogUrlFromCache(gem) // eslint-disable-line prefer-const
if (!found) {
changeLogUrl = await searchChangeLogUrl(gem, option)
}
return {gem, changeLogUrl}
} catch (error: unknown) {
if (error instanceof Error) {
core.info(`[warning] rubyGemsChangeLogUrl: ${error.message}`)
} else {
core.info(`[warning] rubyGemsChangeLogUrl: ${error}`)
}
return {gem, changeLogUrl: null}
}
return {gem, changeLogUrl}
}

let restoredCache: Map<string, string | null>
Expand Down

0 comments on commit 195ad4c

Please sign in to comment.