mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-24 23:15:13 +00:00
revert AiScript hack for plugins
aiscript 0.19 should have fixed the problem, and no longer `abort` when an error gets handled (or, in this case, logged)
This commit is contained in:
parent
c0fc6ce8cd
commit
f0dd0b8993
1 changed files with 4 additions and 25 deletions
|
@ -28,31 +28,10 @@ export async function install(plugin: Plugin): Promise<void> {
|
|||
},
|
||||
log: (): void => {
|
||||
},
|
||||
/* dakkar 2024-06-20
|
||||
|
||||
passing an `err` triggers an unwanted side-effect inside the
|
||||
AiScript Interpreter:
|
||||
|
||||
- the plugin code throws an exception of any kind (in the
|
||||
specific case that made us look, it was `note.text.split(...)`
|
||||
on a note with no text)
|
||||
|
||||
- the Interpreter's `handleError` calls `this.abort()` before
|
||||
calling our `err`
|
||||
|
||||
- from that point on, every evaluation of that Interpreter object
|
||||
returns null
|
||||
|
||||
- which, at least inside a noteViewInterruptor, causes all notes
|
||||
to be replaced with a null
|
||||
|
||||
I'm reporting this problem upstream, in the meantime we'll have
|
||||
to do without error logs
|
||||
*/
|
||||
// err: (err): void => {
|
||||
// pluginLogs.value.get(plugin.id).push(`${err}`);
|
||||
// throw err; // install時のtry-catchに反応させる
|
||||
// },
|
||||
err: (err): void => {
|
||||
pluginLogs.value.get(plugin.id).push(`${err}`);
|
||||
throw err; // install時のtry-catchに反応させる
|
||||
},
|
||||
});
|
||||
|
||||
initPlugin({ plugin, aiscript });
|
||||
|
|
Loading…
Reference in a new issue