Print track names when invalid track provided (#151)

* Print track names when invalid track provided

* Remove redundant safe call
This commit is contained in:
Jack Boswell
2022-10-24 01:06:38 -07:00
committed by GitHub
parent b84eace68d
commit 81a2f1ad1c
2 changed files with 3 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -158,7 +158,8 @@ async function validateSelectedTrack(appEditId: string, options: EditOptions): P
// Check whether the track is valid
if (allTracks.find(value => value.track == options.track) == undefined) {
throw Error(`Track "${options.track}" could not be found `);
const allTrackNames = allTracks.map((track) => { return track.track });
throw Error(`Track "${options.track}" could not be found. Available tracks are: ${allTrackNames.toString()}`);
}
}