Open zdila opened 2 years ago
Maybe errors should be re-thrown like this:
try {
handler(params);
} catch (err) {
process.nextTick(() => {
throw err;
});
}
My workaround:
function propagateHandlerError<T extends any[]>(
fn: (...params: T) => void
) {
return (...params: T) => {
try {
fn(...params);
} catch (err) {
process.nextTick(() => {
throw err;
});
}
};
}
properties.on('PropertiesChanged', propagateHandlerError((iface, changed, invalidated) => {
throw new Error('ew');
}));
Hello,
First thanks for the great library.
I have a question about how to make errors thrown from handlers to be (at least) logged.
For example:
Thanks.