Throughout the codebase we use our in-house logger. This is great for most cases, although makes error handling pretty tricky (requiring us to return nil values or error values instead of yielding proper errors).
Lua has error handling built in and even though it might not be the best in the world, it is much better than our current system.
This would require a rewrite of large portions of the codebase. Functions would properly invoke the standard error() function whenever something went wrong, allowing functions higher up the call stack to intercept the error and handle it appropriately.
It might even be possible to create a general error handling library inspired by sum types or Zig's error handling scheme. This library could be pushed to luarocks for everyone to use. I'm happy to hear some thoughts :)
Throughout the codebase we use our in-house logger. This is great for most cases, although makes error handling pretty tricky (requiring us to return nil values or error values instead of yielding proper errors).
Lua has error handling built in and even though it might not be the best in the world, it is much better than our current system.
This would require a rewrite of large portions of the codebase. Functions would properly invoke the standard
error()
function whenever something went wrong, allowing functions higher up the call stack to intercept the error and handle it appropriately.It might even be possible to create a general error handling library inspired by sum types or Zig's error handling scheme. This library could be pushed to luarocks for everyone to use. I'm happy to hear some thoughts :)