File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -52,16 +52,19 @@ async function getRubyEngineAndVersion(rubyVersion) {
5252 const stableVersions = response . data
5353 const engineVersions = stableVersions [ engine ]
5454 if ( ! engineVersions ) {
55- throw new Error ( `Unknown engine ${ engine } (${ rubyVersion } )` )
55+ throw new Error ( `Unknown engine ${ engine } (input: ${ rubyVersion } )` )
5656 }
5757
5858 if ( ! engineVersions . includes ( version ) ) {
59- engineVersions . reverse ( ) // inplace!
60- let found = engineVersions . find ( v => v . startsWith ( version ) )
59+ const latestToFirstVersion = engineVersions . slice ( ) . reverse ( )
60+ const found = latestToFirstVersion . find ( v => v . startsWith ( version ) )
6161 if ( found ) {
6262 version = found
6363 } else {
64- throw new Error ( `Unknown version ${ version } (${ rubyVersion } )` )
64+ throw new Error ( `Unknown version ${ version } for ${ engine }
65+ input: ${ rubyVersion }
66+ available versions for ${ engine } : ${ engineVersions . join ( ', ' ) }
67+ File an issue at https://github.com/eregon/ruby-install-builder/issues if would like support for a new version` )
6568 }
6669 }
6770
You can’t perform that action at this time.
0 commit comments