add catch

This commit is contained in:
Jade (Rose) Rowland 2024-06-01 12:42:07 -04:00
parent bf7fe2bf75
commit 321a888921

View File

@ -65,7 +65,8 @@ export function registerSamplesFromDB(config = userSamplesDBConfig, onComplete =
sounds.set(parentDirectory, soundPaths); sounds.set(parentDirectory, soundPaths);
}); });
}), }),
).then(() => { )
.then(() => {
sounds.forEach((soundPaths, key) => { sounds.forEach((soundPaths, key) => {
const value = Array.from(soundPaths); const value = Array.from(soundPaths);
registerSound(key, (t, hapValue, onended) => onTriggerSample(t, hapValue, onended, value), { registerSound(key, (t, hapValue, onended) => onTriggerSample(t, hapValue, onended, value), {
@ -79,6 +80,10 @@ export function registerSamplesFromDB(config = userSamplesDBConfig, onComplete =
logger('imported sounds registered!', 'success'); logger('imported sounds registered!', 'success');
onComplete(); onComplete();
})
.catch((error) => {
logger('Something went wrong while registering saved samples from the index db', 'error');
console.error(error);
}); });
}; };
}); });