clearer error
This commit is contained in:
parent
db1fc399a1
commit
ecfeac4d63
1 changed files with 5 additions and 1 deletions
|
|
@ -115,7 +115,11 @@ const getSampleBufferSource = async (s, n, note, speed) => {
|
|||
}
|
||||
const bank = samples?.[s];
|
||||
if (!bank) {
|
||||
throw new Error(`sample not found: "${s}", try one of ${Object.keys(samples).join(', ')}`);
|
||||
throw new Error(
|
||||
`sample not found: "${s}", try one of ${Object.keys(samples)
|
||||
.map((s) => `"${s}"`)
|
||||
.join(', ')}.`,
|
||||
);
|
||||
}
|
||||
if (typeof bank !== 'object') {
|
||||
throw new Error('wrong format for sample bank:', s);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue