Feature Request: Allow overriding error handler

@Simeon Would it be possible for Codea to allow us to provide our own error handler for whenever Lua encounters an exception? I think it would be nice to be able to provide customized information about the error received (for example, a full stack trace to where the error occurred), and a change I want to make to my module system would also greatly benefit from this. Thoughts?

Actually, as far as my module system is concerned, I’ve found a solution :slight_smile:

So, nevermind, unless there are others who would like this feature as well.

Actually I take that back…my solution only partially works :frowning: Anyway, if you get some time, and don’t think it’s a crappy idea, it would be really helpful to me. Thanks!

Isnt there some lua function to manage erros? pcall()?

Yeah, but that won’t help me here, because I can’t call pcall() on the code that Codea calls (which is, well, all of it…). What I’d really like is for whenever Codea encounters an exception, it checks to see if you’ve installed a custom handler, and if so, calls it with the debug information from the exception. If not, it will just call the default error handler that it’s calling now. Does that make sense?