error handling in client