fix: #11969, match the server side behaviour for filters

if there is an error bubble all the way up
isekai-main
Barış Soner Uşaklı 1 year ago
parent 81961255f1
commit 887dfd7da7

@ -106,14 +106,10 @@ define('hooks', [], () => {
const listeners = Array.from(Hooks.loaded[hookName]); const listeners = Array.from(Hooks.loaded[hookName]);
return listeners.reduce((promise, listener) => promise.then((data) => { return listeners.reduce((promise, listener) => promise.then((data) => {
try {
const result = listener(data); const result = listener(data);
return utils.isPromise(result) ? return utils.isPromise(result) ?
result.then(data => Promise.resolve(data)).catch(e => _onHookError(e, listener, data)) : result.then(data => Promise.resolve(data)) :
result; result;
} catch (e) {
return _onHookError(e, listener, data);
}
}), Promise.resolve(data)); }), Promise.resolve(data));
}; };

Loading…
Cancel
Save