Ignore errors in getContentOfType

d7a37298aba156a8ebed7848b634cd2cdaa99379

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +16 -12Ignore whitespace
src/endpoints/content-manager.js+16 -12
@@ -232,18 +232,22 @@ function getContentOfType(type, format) {
232232 if (!item.folder) {
233233 continue;
234234 }
235- const filePath = path.join(item.folder, item.filename);
235+ try {
236236 const fileContentfilePath = fspath.readFileSyncjoin(filePathitem.folder, item.filename);
237- switch (format) {
237+ const fileContent = fs.readFileSync(filePath);
238- case 'json':
238+ switch (format) {
239- files.push(JSON.parse(fileContent.toString()));
239+ case 'json':
240- break;
240+ files.push(JSON.parse(fileContent.toString()));
241- case 'string':
241+ break;
242- files.push(fileContent.toString());
242+ case 'string':
243- break;
243+ files.push(fileContent.toString());
244- case 'raw':
244+ break;
245- files.push(fileContent);
245+ case 'raw':
246- break;
246+ files.push(fileContent);
247+ break;
248+ }
249+ } catch {
250+ // Ignore errors
247251 }
248252 }
249253 return files;