error/panic/abort: move writeHeader to end of call-chain
Revert "error/panic/abort: move writeHeader to end of call-chain"

This reverts commit 56f4085698b80ded9df8d8e952962c4b67207030.