Handle error on the client