mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Ignore errors in getContentOfType
This commit is contained in:
@ -232,18 +232,22 @@ function getContentOfType(type, format) {
|
||||
if (!item.folder) {
|
||||
continue;
|
||||
}
|
||||
const filePath = path.join(item.folder, item.filename);
|
||||
const fileContent = fs.readFileSync(filePath);
|
||||
switch (format) {
|
||||
case 'json':
|
||||
files.push(JSON.parse(fileContent.toString()));
|
||||
break;
|
||||
case 'string':
|
||||
files.push(fileContent.toString());
|
||||
break;
|
||||
case 'raw':
|
||||
files.push(fileContent);
|
||||
break;
|
||||
try {
|
||||
const filePath = path.join(item.folder, item.filename);
|
||||
const fileContent = fs.readFileSync(filePath);
|
||||
switch (format) {
|
||||
case 'json':
|
||||
files.push(JSON.parse(fileContent.toString()));
|
||||
break;
|
||||
case 'string':
|
||||
files.push(fileContent.toString());
|
||||
break;
|
||||
case 'raw':
|
||||
files.push(fileContent);
|
||||
break;
|
||||
}
|
||||
} catch {
|
||||
// Ignore errors
|
||||
}
|
||||
}
|
||||
return files;
|
||||
|
Reference in New Issue
Block a user