\subsection{a}\section{b} fails with an invalid field access for pos.
The transform phase should handle some empty hierarchy elements, even if not all of them.
Regardless of it being forbidden (say, for chapters) or not, errors should be graceful and informative, and should generally not require the use of the debug mode (setting DEBUG=1 in the environment).
@lehonma , can you take some time to improve error handling there?
commit: ae1de9e
target: js
error: TypeError: Cannot read property 'pos' of null
call stack:
Called from transform_Transform.hierarchy (/home/jonas/Code/brtpg/generator/bin/obrt.js line 5235)
Called from transform_Transform.vertical (/home/jonas/Code/brtpg/generator/bin/obrt.js line 5311)
Called from transform_Transform.consume (/home/jonas/Code/brtpg/generator/bin/obrt.js line 5270)
Called from transform_Transform.hierarchy (/home/jonas/Code/brtpg/generator/bin/obrt.js line 5225)
Called from transform_Transform.vertical (/home/jonas/Code/brtpg/generator/bin/obrt.js line 5309)
Called from transform_Transform.consume (/home/jonas/Code/brtpg/generator/bin/obrt.js line 5270)
Called from transform_Transform.hierarchy (/home/jonas/Code/brtpg/generator/bin/obrt.js line 5225)
Called from transform_Transform.vertical (/home/jonas/Code/brtpg/generator/bin/obrt.js line 5307)
Called from transform_Transform.vertical (/home/jonas/Code/brtpg/generator/bin/obrt.js line 5376)
Called from transform_Transform.consume (/home/jonas/Code/brtpg/generator/bin/obrt.js line 5270)
\subsection{a}\section{b}
fails with an invalid field access forpos
.The transform phase should handle some empty hierarchy elements, even if not all of them.
Regardless of it being forbidden (say, for chapters) or not, errors should be graceful and informative, and should generally not require the use of the debug mode (setting
DEBUG=1
in the environment).@lehonma , can you take some time to improve error handling there?