error handling on the client