Fix error with logging in SimpleQueuedHandler handler

This commit is contained in:
Jonathan Dextraze 2019-06-06 11:42:22 -07:00
parent 76a405ace2
commit 4ae4c1e010

View File

@ -13,11 +13,12 @@ function SimpleQueuedHandler(log) {
SimpleQueuedHandler.prototype.registerHandler = function(type, handler) {
var typeId = typeName(type);
var log = this._log;
this._handlers[typeId] = function (msg) {
try {
handler(msg);
} catch(e) {
this._log.error('handle for', type, 'failed:', e.stack);
log.error('handle for', type, 'failed:', e.stack);
}
};
};