Milkman
Milkman

Reputation: 87

How to set the error output stream for lua in c++

I've implemented lua in my c++ project but right now it writes all errors and syntax errors to the console. Is there way to set a custom function in c++ to receive the errors instead?

Upvotes: 1

Views: 362

Answers (1)

BMitch
BMitch

Reputation: 265190

Run your Lua code using lua_pcall and retrieve your errors from the result.

Upvotes: 2

Related Questions