add WriteErrorString()

Add a convenient function