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) flavorUsesAutomaticObjectSerialization(Flavor)
when not isAutomatic: when not isAutomatic:
const typeName = typetraits.name(T) const
{.error: "Please override readValue for the " & flavor =
typeName & "JsonReader[" & typetraits.name(typeof(r).Flavor) & "], " &
" type (or import the module where the override is provided)".} typetraits.name(T)
{.error:
"Missing Json serialization import or implementation for readValue(" &
flavor & ")".}
readRecordValue(r, value) readRecordValue(r, value)
else: else: