From 6fbaeb61cab889f74870372bc00cc99371e16794 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Wed, 18 Mar 2020 18:14:29 +0200 Subject: [PATCH] Switch to json_serialition.JsonString to facilitate Chronicles logging --- json_rpc/router.nim | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/json_rpc/router.nim b/json_rpc/router.nim index fcb13b8..2aa5f08 100644 --- a/json_rpc/router.nim +++ b/json_rpc/router.nim @@ -1,14 +1,17 @@ import - json, tables, chronos, jsonmarshal, strutils, macros, - chronicles, options -export chronos, json, jsonmarshal + json, tables, strutils, macros, options, + chronicles, chronos, json_serialization/writer, + jsonmarshal + +export + chronos, json, jsonmarshal type RpcJsonError* = enum rjeInvalidJson, rjeVersionError, rjeNoMethod, rjeNoId, rjeNoParams, rjeNoJObject RpcJsonErrorContainer* = tuple[err: RpcJsonError, msg: string] - StringOfJson* = distinct string + StringOfJson* = JsonString # Procedure signature accepted as an RPC call by server RpcProc* = proc(input: JsonNode): Future[StringOfJson] {.gcsafe.}