Remove concatenation

This commit is contained in:
coffeepots 2018-06-05 11:12:55 +01:00
parent efeb972763
commit 179a6f6024
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ proc wrapReply*(id: JsonNode, value: JsonNode, error: JsonNode): JsonNode =
proc sendError*(client: AsyncSocket, code: int, msg: string, id: JsonNode, data: JsonNode = newJNull()) {.async.} =
## Send error message to client
let error = %{"code": %(code), "message": %msg, "data": data}
ifDebug: echo "Send error json: ", wrapReply(newJNull(), error, id).pretty & "\c\l"
ifDebug: echo "Send error json: ", wrapReply(newJNull(), error, id).pretty, "\c\l"
# REVIEW: prefer in-place appending instead of string concatenation
# (see the similar comment in clientdispatch.nim)
result = client.send($wrapReply(id, newJNull(), error) & "\c\l")