Skip to content

Commit 7824eca

Browse files
committed
context: report all stored errors
Do not report only the first one as we might miss some. Fixes: 6dae8ee ("context: allow explicitly destroying") Signed-off-by: Robin Jarry <robin@jarry.cc>
1 parent ca2e3b3 commit 7824eca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libyang/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ def error(self, msg, *args):
8383

8484
if self._ctx:
8585
err = lib.ly_err_first(self._ctx)
86-
if err:
86+
while err:
8787
if err.msg:
8888
msg += ': %s' % c2str(err.msg)
8989
if err.path:
9090
msg += ': %s' % c2str(err.path)
91+
err = err.next
9192
lib.ly_err_clean(self._ctx, ffi.NULL)
9293

9394
return LibyangError(msg)

0 commit comments

Comments
 (0)