mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
Better plugin error handling
This commit is contained in:
parent
a89c81f62f
commit
26d9c3ed53
2 changed files with 20 additions and 5 deletions
|
@ -80,7 +80,12 @@ exports.extractHooks = function (parts) {
|
|||
Object.keys(part.hooks || {}).forEach(function (hook_name) {
|
||||
if (hooks[hook_name] === undefined) hooks[hook_name] = [];
|
||||
var hook_fn_name = part.hooks[hook_name];
|
||||
hooks[hook_name].push({"hook": exports.loadFn(part.hooks[hook_name]), "part": part});
|
||||
var hook_fn = exports.loadFn(part.hooks[hook_name]);
|
||||
if (hook_fn) {
|
||||
hooks[hook_name].push({"hook": hook_fn, "part": part});
|
||||
} else {
|
||||
console.error("Unable to load hook function for " + part.full_name + " for hook " + hook_name + ": " + part.hooks[hook_name]);
|
||||
}
|
||||
});
|
||||
});
|
||||
return hooks;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue