You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After I have registered a callback to a luv handle, when the callback need to be called, we use luv_call_callback to call it.
It's is OK when there is no exception when calling the callback function. But when error occured, it just print the stack traceback and call exit to end the process.
I think it is better to provide an alternative way just like "uncaughtException" in nodejs to allow user to do more control.
And I think luv_call_callback should to be exported just like "MakeCallback" in NAN, so it can provide a consistent error handling machanism when I write a extension for luv.
The text was updated successfully, but these errors were encountered:
The idea is that error handling will be handled at the lua level instead of at the C level. The fatal exit here is to prevent strange undefined behavior when errors go uncaught.
After thinking about this for a while, I do think this needs to be handled at the luv level. How exactly does NAN make MakeCallback configurable? My idea is to allow customizing from the lua side a function that intercepts all call stacks:
functionluv.makeCallback(fn)
-- do anything custom here if desiredreturnfnend
And so a custom one would wrap in xpcall and route errors
After I have registered a callback to a luv handle, when the callback need to be called, we use luv_call_callback to call it.
It's is OK when there is no exception when calling the callback function. But when error occured, it just print the stack traceback and call exit to end the process.
I think it is better to provide an alternative way just like "uncaughtException" in nodejs to allow user to do more control.
And I think luv_call_callback should to be exported just like "MakeCallback" in NAN, so it can provide a consistent error handling machanism when I write a extension for luv.
The text was updated successfully, but these errors were encountered: