Skip to content

Commit 8e8c5c9

Browse files
Improve htmldocck error a bit by providing line where error occurred
1 parent 8f5787a commit 8e8c5c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/etc/htmldocck.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ def get_commands(template):
274274
args = shlex.split(args)
275275
except UnicodeEncodeError:
276276
args = [arg.decode('utf-8') for arg in shlex.split(args.encode('utf-8'))]
277+
except Exception as exc:
278+
raise Exception("line {}: {}".format(lineno + 1, exc)) from None
277279
yield Command(negated=negated, cmd=cmd, args=args, lineno=lineno+1, context=line)
278280

279281

0 commit comments

Comments
 (0)