save error information to a file