diff --git a/botocore/waiter.py b/botocore/waiter.py index 6f41f8a4fc..a0d2834bcb 100644 --- a/botocore/waiter.py +++ b/botocore/waiter.py @@ -303,11 +303,11 @@ def wait(self, **kwargs): # transition to the failure state if an error # response was received. if 'Error' in response: - # Transition to the failure state, which we can - # just handle here by raising an exception. - raise WaiterError( - name=self.name, - reason=response['Error'].get('Message', 'Unknown')) + # This was a ClientError that was not handled in an + # acceptor. Raise a ClientError again + raise ClientError( + error_response=response, + operation_name=self.config.operation) if current_state == 'success': logger.debug("Waiting complete, waiter matched the " "success state.") diff --git a/tests/unit/test_waiters.py b/tests/unit/test_waiters.py index 3de747cdfa..adef191abc 100644 --- a/tests/unit/test_waiters.py +++ b/tests/unit/test_waiters.py @@ -358,7 +358,7 @@ def test_unspecified_errors_stops_waiter(self): for_operation=operation_method ) waiter = Waiter('MyWaiter', config, operation_method) - with self.assertRaises(WaiterError): + with self.assertRaises(ClientError): waiter.wait() def test_unspecified_errors_propagate_error_code(self): @@ -378,7 +378,7 @@ def test_unspecified_errors_propagate_error_code(self): ) waiter = Waiter('MyWaiter', config, operation_method) - with self.assertRaisesRegexp(WaiterError, error_message): + with self.assertRaisesRegexp(ClientError, error_message): waiter.wait() def test_waiter_transitions_to_failure_state(self):