GentenStudios / Phoenix-OLD

Phoenix is an open world sandbox style voxel game designed to make all content optional.
BSD 3-Clause "New" or "Revised" License
30 stars 10 forks source link

Missing message in Lua panic handler #360

Closed apachano closed 3 years ago

apachano commented 3 years ago

Describe the bug

When lua throws a panic after attempting to call a nil value, no message is supplied to CustomPanicHandler in ModManager.cpp. The default message handler gets the error message.

To Reproduce

Steps to reproduce the behavior:

  1. Add a nil function call to a lua file (ex add core.print("message") as this doesn't actually exist as a registered function
  2. Run game and observe generic error
  3. Comment out panic handler registration in ModManager.cpp m_luaState.set_panic( sol::c_call<decltype(&CustomPanicHandler), &CustomPanicHandler>);
  4. Run again and observe default panic handler throws verbose error

Expected behavior

We should be getting the same error as the default panic handler

Additional context

Last occurred in commit a1adf386

apachano commented 3 years ago

Possibly related: https://github.com/ThePhD/sol2/issues/965

JosiahWI commented 3 years ago

361 fixes this issue.