Jump to content
  • Advertisement
Sign in to follow this  
ken_masters

luabind xpcall?

This topic is 3685 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Familiar with luabind? It's an incredibly good LUA wrapper! However, I have a problem! Consider this sample code: try { luabind::call_function<void>(pLuaState, "foo", x); } catch (luabind::error &e) { luabind::object error_msg(luabind::from_stack(e.state(), -1)); stringstream ss; ss << error_msg; DisplayError(ss.str()); } The lua-file: function foo(x) return foo.bar(x) -- Here we get a runtime error! '.' should be ':' end The problem is that the error does not contain information about where the error occurred. In this case, it should say "foo.lua:2 error" but it will only show "error". How do I make sure the file name and line number are valid when such a function call fails? (I've read about the "xpcall", but I can't figure out how to use it with luabind.)

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!