Skip to content

Commit

Permalink
Print track names when invalid track provided (r0adkll#151)
Browse files Browse the repository at this point in the history
* Print track names when invalid track provided

* Remove redundant safe call
  • Loading branch information
boswelja authored Oct 24, 2022
1 parent b84eace commit 81a2f1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/edits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`);
}
}

Expand Down

0 comments on commit 81a2f1a

Please sign in to comment.