Skip to content

Commit

Permalink
only skip SyntaxError exception
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocarvalhodev committed Jul 22, 2024
1 parent 798ac3b commit f20172f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/arfs/arfsdao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1539,8 +1539,12 @@ export class ArFSDAO extends ArFSDAOAnonymous {
return this.caches.privateFolderCache.put(cacheKey, Promise.resolve(folder));
} catch (e) {
// If the folder is broken, skip it
console.error(`Error building folder: ${e}`);
return null;
if (e instanceof SyntaxError) {
console.error(`Error building folder. Skipping... Error: ${e}`);
return null;
}

throw e;
}
});

Expand Down
8 changes: 6 additions & 2 deletions src/arfs/arfsdao_anonymous.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,12 @@ export class ArFSDAOAnonymous extends ArFSDAOType {
return folder;
} catch (e) {
// If the folder is broken, skip it
console.error(`Error building folder: ${e}`);
return null;
if (e instanceof SyntaxError) {
console.error(`Error building folder. Skipping... Error: ${e}`);
return null;
}

throw e;
}
});

Expand Down

0 comments on commit f20172f

Please sign in to comment.