diff --git a/yaml/serialization.nim b/yaml/serialization.nim index 7c9e485..cd48082 100644 --- a/yaml/serialization.nim +++ b/yaml/serialization.nim @@ -204,8 +204,8 @@ proc constructObject*[T: int8|int16|int32|int64]( # make sure we don't produce a range error result = T(nInt) else: - # if outside of range, what to do?! - raise newException(YamlConstructionError, "AAA") + raise s.constructionError("Cannot construct int; out of range: " & + $nInt & " for type " & T.name & " with max of: " & $T.high) proc constructObject*(s: var YamlStream, c: ConstructionContext, result: var int)