Added a unit test for handle_client_error