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) {
232 if (!item.folder) {232 if (!item.folder) {
233 continue;233 continue;
234 }234 }
235 const filePath = path.join(item.folder, item.filename);235 try {
236 const fileContent = fs.readFileSync(filePath);236 const filePath = path.join(item.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
247 }251 }
248 }252 }
249 return files;253 return files;