mirror of https://github.com/status-im/NimYAML.git
Fixes #76
This commit is contained in:
parent
e6ac75d86a
commit
f8b264f992
|
@ -67,7 +67,7 @@ proc constructChild*[T](s: var YamlStream, c: ConstructionContext,
|
||||||
|
|
||||||
proc constructChild*[O](s: var YamlStream, c: ConstructionContext,
|
proc constructChild*[O](s: var YamlStream, c: ConstructionContext,
|
||||||
result: var ref O)
|
result: var ref O)
|
||||||
{.raises: [YamlStreamError].}
|
{.raises: [YamlConstructionError, YamlStreamError].}
|
||||||
## Constructs an arbitrary Nim value from a part of a YAML stream.
|
## Constructs an arbitrary Nim value from a part of a YAML stream.
|
||||||
## The stream will advance until after the finishing token that was used
|
## The stream will advance until after the finishing token that was used
|
||||||
## for constructing the value. The object may be constructed from an alias
|
## for constructing the value. The object may be constructed from an alias
|
||||||
|
@ -1248,9 +1248,7 @@ proc constructChild*[O](s: var YamlStream, c: ConstructionContext,
|
||||||
else: internalError("Unexpected event kind: " & $e.kind)
|
else: internalError("Unexpected event kind: " & $e.kind)
|
||||||
s.peek = e
|
s.peek = e
|
||||||
try: constructChild(s, c, result[])
|
try: constructChild(s, c, result[])
|
||||||
except YamlConstructionError:
|
except YamlConstructionError as e:
|
||||||
var e = newException(YamlStreamError, getCurrentExceptionMsg())
|
|
||||||
e.parent = getCurrentException()
|
|
||||||
raise e
|
raise e
|
||||||
except YamlStreamError as e:
|
except YamlStreamError as e:
|
||||||
raise e
|
raise e
|
||||||
|
|
Loading…
Reference in New Issue