Skip to content

Commit bc79664

Browse files
fix implicit lua number to .net conversion
fix .net exceptions not halting the running script fix inconsistency with stdout and lua console printing errors, both should end in a newline now print the inner exception of a lua exception (i.e. the .net extension) if possible
1 parent eb00019 commit bc79664

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Assets/dll/NLua.dll

0 Bytes
Binary file not shown.

References/NLua.dll

0 Bytes
Binary file not shown.

src/BizHawk.Client.Common/lua/LuaSandbox.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ private void Sandbox(Action callback, Action exceptionCallback)
5858
}
5959
catch (NLua.Exceptions.LuaException ex)
6060
{
61-
Console.WriteLine(ex);
62-
DefaultLogger(ex.ToString());
61+
var exStr = ex.ToString() + '\n';
62+
if (ex.InnerException is not null)
63+
{
64+
exStr += ex.InnerException.ToString() + '\n';
65+
}
66+
67+
Console.Write(exStr);
68+
DefaultLogger(exStr);
6369
exceptionCallback?.Invoke();
6470
}
6571
finally

0 commit comments

Comments
 (0)