fix: add error handling in processScriptFull for display mode

This commit is contained in:
Kwaroran
2025-02-15 22:03:18 +09:00
parent 793aefc054
commit c8c243bf08

View File

@@ -109,15 +109,20 @@ export async function processScriptFull(char:character|groupChat|simpleCharacter
if(mode === 'editdisplay'){ if(mode === 'editdisplay'){
const currentChar = getCurrentCharacter() const currentChar = getCurrentCharacter()
if(currentChar.type !== 'group'){ if(currentChar.type !== 'group'){
const perf = performance.now() try{
const d = await runTrigger(currentChar, 'display', { const perf = performance.now()
chat: getCurrentChat(), const d = await runTrigger(currentChar, 'display', {
displayMode: true, chat: getCurrentChat(),
displayData: data displayMode: true,
}) displayData: data
})
data = d.displayData ?? data
console.log('Trigger time', performance.now() - perf) data = d.displayData ?? data
console.log('Trigger time', performance.now() - perf)
}
catch(e){
console.error(e)
}
} }
} }