Improve htmldocck error a bit by providing line where error occurred

This commit is contained in:
Guillaume Gomez 2023-07-19 14:27:52 +02:00
parent 8f5787abba
commit 8e8c5c9f7e

@ -274,6 +274,8 @@ def get_commands(template):
args = shlex.split(args)
except UnicodeEncodeError:
args = [arg.decode('utf-8') for arg in shlex.split(args.encode('utf-8'))]
except Exception as exc:
raise Exception("line {}: {}".format(lineno + 1, exc)) from None
yield Command(negated=negated, cmd=cmd, args=args, lineno=lineno+1, context=line)