Reconfigurable intelligent surface (RIS) or intelligent reflecting surface (IRS) has recently been envisioned as one of the most promising technologies in the future sixth-generation (6G) communications. In this paper, we consider the joint optimization of the transmit beamforming at the base station (BS) and the phase shifts at the RIS for an RIS-aided wireless communication system with both hardware impairments and imperfect channel state information (CSI). Specifically, we assume both the BS-user channel and the BS-RIS-user channel are imperfect due to the channel estimation error, and we consider the channel estimation error under the statistical CSI error model. Then, the transmit power of the BS is minimized, subject to the outage probability constraint and the unit-modulus constraints on the reflecting elements. By using Bernstein-type inequality and semidefinite relaxation (SDR) to reformulate the constraints, we transform the optimization problem into a semidefinite programming (SDP) problem. Numerical results show that the proposed robust design algorithm can ensure communication quality of the user in the presence of both hardware impairments and imperfect CSI.