Use rwrite() to output the err_msg string.