From c869dae884336e1bca134ccb8ea1a37517d16a29 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Tue, 20 Feb 2024 20:19:02 +0100 Subject: [PATCH] include flavor in missing `readValue` error (#86) --- json_serialization/reader_impl.nim | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/json_serialization/reader_impl.nim b/json_serialization/reader_impl.nim index 69009b9..13563ec 100644 --- a/json_serialization/reader_impl.nim +++ b/json_serialization/reader_impl.nim @@ -328,10 +328,13 @@ proc readValue*[T](r: var JsonReader, value: var T) flavorUsesAutomaticObjectSerialization(Flavor) when not isAutomatic: - const typeName = typetraits.name(T) - {.error: "Please override readValue for the " & - typeName & - " type (or import the module where the override is provided)".} + const + flavor = + "JsonReader[" & typetraits.name(typeof(r).Flavor) & "], " & + typetraits.name(T) + {.error: + "Missing Json serialization import or implementation for readValue(" & + flavor & ")".} readRecordValue(r, value) else: