Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waiter throw ClientError for unexpected error response #957

Merged
merged 1 commit into from
Aug 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions botocore/waiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_waiters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down