Throw exception on invalid header rendering