Skip to content

Commit

Permalink
fix: #11969, match the server side behaviour for filters
Browse files Browse the repository at this point in the history
if there is an error bubble all the way up
  • Loading branch information
barisusakli committed Aug 30, 2023
1 parent 8196125 commit 887dfd7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions public/src/modules/hooks.js
Expand Up @@ -106,14 +106,10 @@ define('hooks', [], () => {

const listeners = Array.from(Hooks.loaded[hookName]);
return listeners.reduce((promise, listener) => promise.then((data) => {
try {
const result = listener(data);
return utils.isPromise(result) ?
result.then(data => Promise.resolve(data)).catch(e => _onHookError(e, listener, data)) :
result;
} catch (e) {
return _onHookError(e, listener, data);
}
const result = listener(data);
return utils.isPromise(result) ?
result.then(data => Promise.resolve(data)) :
result;
}), Promise.resolve(data));
};

Expand Down

0 comments on commit 887dfd7

Please sign in to comment.