Repository navigation
Conversation
|
Might look into the other ScRTs as the same issue might be there as well. I'll probably open separate PRs for those in that case |
107dee1 to
03499c6
Compare
|
Will this work correctly when interacting with other languages (JS/C#)? |
|
Yeah, this PR currently only fixes exports created with Lua. If other languages use Lua exports it will be fine, but the other languages still have broken exports. I'm on/off on making a fix for the other languages because the underlying code for those seems a bit weirder than the Lua scheduler. |
Are you sure they will work correctly? Because other runtimes will still be expecting the msgpack'd result to only contain the result, not the bool/value pair. |
|
Ah, I get what you're saying. I'll check later today, but now that I think about it it probably won't work without the fix being in the other langs. |
|
Ok, I think I figured out the fix for JS, next up is C# and then I'll update the PR |
f3999a3 to
1f821dc
Compare
|
@iridium-cfx PR has been updated with a fix for the rest of the languages. |
|
This will help with debugging a lot, big upvote for this 👊 |
|
Oops.... |
|
Converted to draft as this currently only works when the top-level code isn't in a function reference. |
e8fc5ee to
2174a5c
Compare
2174a5c to
5c3065c
Compare
e015583 to
f8c1e3a
Compare
Goal of this PR
Return the result error when function references throw them.
This both fixes
pcallnot being able to catch and prevent errors from being printed, but also improves the error message(s) when the function reference isn't wrapped in apcall.Before & After
Lua
Resource
a(callee)Resource
b(caller)Before
After
Lua (with pcall)
Resource
a(callee)Resource
b(caller)Before
After
JavaScript
Resource
a(callee)Resource
b(caller)Before
After
JavaScript (with try/catch)
Resource
a(callee)Resource
b(caller)Before
After
C#
Resource
a(callee)Resource
b(caller)Before
After
C# (with try/catch)
Resource
a(callee)Resource
b(caller)Before
(!)
Post run funcappears in this log meaning the function reference error doesn't stop the rest of the code.After
Mono v2
Resource
av2(callee)Resource
bv2(caller)Before
(!)
Post run funcappears in this log meaning the function reference error isn't thrown up to the callee.After
Mono v2 (with try/catch)
Resource
av2(callee)Resource
bv2(caller)Before
(!)
Post try run funcappears in this log meaning the function reference error isn't thrown up to the callee.After
How is this PR achieving the goal
Error handling for function references is done in the scheduler, so when an error is detected, simply throw it rather than printing it and throwing
nil.This PR applies to the following area(s)
ScRT: Lua, ScRT: C#, ScRT: JS
Successfully tested on
Platforms: Windows
Checklist
Fixes issues
Fixes #3501