mirror of https://github.com/zulip/zulip.git
zjquery: Give clear error when handlers are not set.
This commit is contained in:
parent
5e6649ba87
commit
2d8c1f6d93
|
@ -26,7 +26,10 @@ exports.make_zjquery = function () {
|
||||||
on_functions.set(event_name, arg);
|
on_functions.set(event_name, arg);
|
||||||
} else {
|
} else {
|
||||||
var handler = on_functions.get(event_name);
|
var handler = on_functions.get(event_name);
|
||||||
assert(handler);
|
if (!handler) {
|
||||||
|
var error = 'Cannot find ' + event_name + ' handler for ' + selector;
|
||||||
|
throw Error(error);
|
||||||
|
}
|
||||||
handler(arg);
|
handler(arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue