-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
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
error handling without exceptions #60
Comments
Hello. Just to understand a little bit more, you mean instead of I had wanted to (unrelated to this issue slightly) allow users to set the |
I have some ideas, the feature requires are:
The first is simple, just use lua_pcall instead (and maybe add a luaL_traceback wrapper or just retrieve debug.traceback()). But I don't have mind about the second: what result the call() return? maybe a |
I can start on this by setting up a function pointer to be called on lua_atpanic. Since it's coupled to the lua_State, it can be passed into the constructor for As a sidenote, I've never worked without exceptions. If you turn them off, what happens when you |
@starwing As a quick question, do you use |
Preliminary support. I do not have the mechanism for having a "error message handler", but I believe I would add functionality to add that kind of trampoline to
Note that if you captured |
Custom handling seems to work in #62. But, in order to make this work with handlers there's a wee bit of extra overhead (to set the special handler). Should probably use a little extra template magic to eliminate the runtime check for a handler if the user specifies that its a no-fail function.
|
That's awesome! Sorry for late reply as I'm working hard on Lua scripts for Unity client :( I will look into this but this is really awesome! Thank you for your really outstanding work! |
Hi, I found this library do not use lua_pcall. I prefer to call a lua function with a message handler to offer a stack trace in error. so a function like lua.where() and lua.error([msg before where]) is good. have some plans to support this?
The text was updated successfully, but these errors were encountered: