include flavor in missing `readValue` error (#86)

This commit is contained in:
Jacek Sieka 2024-02-20 20:19:02 +01:00 committed by GitHub
parent da49e0e0c5
commit c869dae884
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 4 deletions

View File

@ -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: