Changing WriteMessage to return an error string if too many attempts
occur.