Skip to content

Commit

Permalink
Refine errors text
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed May 30, 2024
1 parent 12dfa2b commit a56d16e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions dist/index.js

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

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
if (found) {
version = found
} else {
throw new Error(`Unknown version ${parsedVersion} for ${engine} on ${platform}.
Available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}.
throw new Error(`Unknown version ${parsedVersion} for ${engine} on ${platform}
Available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}
Make sure you use the latest version of the action with - uses: ruby/setup-ruby@v1`)
}
}
Expand Down
6 changes: 3 additions & 3 deletions ruby-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
try {
return await tc.downloadTool(url)
} catch (error) {
if (error.message.endsWith('404')) {
throw new Error(`Unavailable version ${version} for ${engine} on ${platform}.
You can request it at https://github.com/ruby/setup-ruby/issues.
if (error.message.includes('404')) {
throw new Error(`Unavailable version ${version} for ${engine} on ${platform}
You can request it at https://github.com/ruby/setup-ruby/issues
Original Error: (${error.message})`)
} else {
throw error
Expand Down

0 comments on commit a56d16e

Please sign in to comment.