Skip to content

Commit

Permalink
style(clustering/rpc): minor code style improvment
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Apr 28, 2024
1 parent c6a8ef8 commit 482a266
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kong/clustering/rpc/json_rpc_v2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function _M.new_error(id, code, msg)
id = id,
error = {
code = code,
message = msg,
message = tostring(msg),
}
}
end
Expand Down
3 changes: 2 additions & 1 deletion kong/clustering/rpc/socket.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ local constants = require("kong.constants")


local assert = assert
local unpack = unpack
local string_format = string.format
local kong = kong
local is_timeout = utils.is_timeout
Expand Down Expand Up @@ -68,7 +69,7 @@ function _M._dispatch(premature, self, cb, payload)
ngx_log(ngx_WARN, "[rpc] RPC callback failed: ", err)

res, err = self.outgoing:push(new_error(payload.id, jsonrpc.SERVER_ERROR,
tostring(err)))
err))
if not res then
ngx_log(ngx_WARN, "[rpc] unable to push RPC call error: ", err)
end
Expand Down

0 comments on commit 482a266

Please sign in to comment.