We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
properties.on('PropertiesChanged', (iface, changed, invalidated) => { throw new Error('ew'); // this is not loged anywhere });
Thanks.
The text was updated successfully, but these errors were encountered:
Maybe errors should be re-thrown like this:
try { handler(params); } catch (err) { process.nextTick(() => { throw err; }); }
Sorry, something went wrong.
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'); }));
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: