more sensible error if cannot write value in emitMap