From 3cb55e7057c1d20b1527e123164584e0d493341e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mamy=20Andr=C3=A9-Ratsimbazafy?= Date: Fri, 29 Mar 2019 13:49:47 +0100 Subject: [PATCH] Print custom exception names --- json_serialization/reader.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json_serialization/reader.nim b/json_serialization/reader.nim index 71f5679..82e1ab1 100644 --- a/json_serialization/reader.nim +++ b/json_serialization/reader.nim @@ -47,7 +47,7 @@ method formatMsg*(err: ref UnexpectedToken, filename: string): string = fmt"{filename}({err.line}, {err.col}) Unexpected token '{err.encountedToken}' in place of '{err.expectedToken}'" method formatMsg*(err: ref CustomSerializationError, filename: string): string = - fmt"{filename}({err.line}, {err.col}) Error while deserializing '{err.deserializedField}': {err.innerException.msg}" + fmt"{filename}({err.line}, {err.col}) Custom serialization exception while deserializing '{err.deserializedField}': [{err.innerException.name}] {err.innerException.msg}" template init*(T: type JsonReader, stream: ByteStreamVar, mode = defaultJsonMode): auto = init JsonReader, AsciiStreamVar(stream), mode