Skip to content

Commit faebd5d

Browse files
committed
Send error too if it is known
1 parent 6d3df05 commit faebd5d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Server.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ end
104104

105105
function process_request(request)
106106
local statusOk, res, errFromRoute = pcall(route_command, request.c, request.p)
107+
request.p = nil
107108
if statusOk then
108109
if not errFromRoute then
109110
request.r = res
@@ -149,7 +150,7 @@ function route_command(command, params)
149150
}
150151
local act = action[command]
151152
if act then
152-
return action[command](), nil
153+
return action[command]()
153154
else
154155
return nil, "No such function"
155156
end

routes.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ end
214214

215215
function routes.send_transaction(transaction)
216216
local err = sendTransaction(transaction)
217-
if err then
217+
if err ~= "" then
218218
return nil, err
219219
else
220220
return true

0 commit comments

Comments
 (0)