format the error message: to_string