Skip to content

Commit

Permalink
Tests: Fix deserializing error return value on deserializeFunctionRun…
Browse files Browse the repository at this point in the history
…/Call. (#3973)

* Fix deserializing error return value on deserializeFunctionRun.
* Fix deserializing error return value on deserializeFunctionCall.
  • Loading branch information
saurtron authored Nov 28, 2024
1 parent 38c5745 commit ef328f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/testing/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ function RPC:deserializeFunctionCall(serializedCall, env)

local callableFunction = function()
local pcallOk, pcallResult = Util.splitFirstElement(Util.pack(pcall(fn, unpack(data.args))))
if not pcallOk then
pcallResult = pcallResult[1]
end
return pcallOk, pcallResult
end

Expand Down Expand Up @@ -134,6 +137,9 @@ function RPC:deserializeFunctionRun(serializedFn)

local callableFunction = function()
local pcallOk, pcallResult = Util.splitFirstElement(Util.pack(pcall(data.fn, localsDictionary)))
if not pcallOk then
pcallResult = pcallResult[1]
end
return pcallOk, pcallResult
end

Expand Down

0 comments on commit ef328f4

Please sign in to comment.