make obs deletion in reset script fault tolerant

This commit is contained in:
Ryan Stelly
2025-11-03 11:43:03 -06:00
parent 9919a6c946
commit b90ac77a6e

View File

@@ -124,10 +124,14 @@ export default async function resetUserForTesting() {
console.log( `Deleting ${observationIdsToDelete.length} observations` );
await Promise.all( observationIdsToDelete.map( async uuid => {
await inatjs.observations.delete(
{ uuid },
opts
);
try {
await inatjs.observations.delete(
{ uuid },
opts
);
} catch ( _error ) {
console.log( `Could not delete observation: ${uuid}. Moving on...` );
}
} ) );
console.log( "Creating sample observation" );