mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
hooks: Delete unused bubbleExceptions
setting
This commit is contained in:
parent
ba02e70020
commit
6b42dabf6c
1 changed files with 1 additions and 13 deletions
|
@ -26,8 +26,6 @@ const checkDeprecation = (hook) => {
|
||||||
// Flattens the array one level.
|
// Flattens the array one level.
|
||||||
const flatten1 = (array) => array.reduce((a, b) => a.concat(b), []);
|
const flatten1 = (array) => array.reduce((a, b) => a.concat(b), []);
|
||||||
|
|
||||||
exports.bubbleExceptions = true;
|
|
||||||
|
|
||||||
const hookCallWrapper = (hook, hookName, args, cb) => {
|
const hookCallWrapper = (hook, hookName, args, cb) => {
|
||||||
if (cb === undefined) cb = (x) => x;
|
if (cb === undefined) cb = (x) => x;
|
||||||
|
|
||||||
|
@ -38,17 +36,7 @@ const hookCallWrapper = (hook, hookName, args, cb) => {
|
||||||
if (x === undefined) return [];
|
if (x === undefined) return [];
|
||||||
return x;
|
return x;
|
||||||
};
|
};
|
||||||
const normalizedhook = () => normalize(hook.hook_fn(hookName, args, (x) => cb(normalize(x))));
|
return () => normalize(hook.hook_fn(hookName, args, (x) => cb(normalize(x))));
|
||||||
|
|
||||||
if (exports.bubbleExceptions) {
|
|
||||||
return normalizedhook();
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
return normalizedhook();
|
|
||||||
} catch (ex) {
|
|
||||||
console.error([hookName, hook.part.full_name, ex.stack || ex]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.syncMapFirst = (lst, fn) => {
|
exports.syncMapFirst = (lst, fn) => {
|
||||||
|
|
Loading…
Reference in a new issue