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

Fix Sqs ErrorType not being parsed properly #3054

Merged
merged 2 commits into from
Nov 11, 2023

Conversation

ziyanli-amazon
Copy link
Contributor

@ziyanli-amazon ziyanli-amazon commented Nov 11, 2023

Customer reporting exception error type is not properly handled after the AwsJson-1.0 migration when calling SQS.

For example, when calling

import boto3
import botocore

sqs = boto3.client('sqs')

try:
    sqs.delete_queue( QueueUrl='foo-nonexistant-queue' )
except sqs.exceptions.QueueDoesNotExist as e:
    print("Successfully caught QueueDoesNotExist")

Message does not printed, but instead exception dump does.

This is because Client is listening to an ErrorCode to throw a modelled factory exception. In the above case, self.client.exceptions.QueueDoesNotExist ErrorType should be thrown. However, as a prerequisite of the AwsJson migration, we modified the ErrorCode to ensure a backwards compatibility. In the above case, ErrorCode should be AWS.SimpleQueueService.NonExistentQueue.

This PR should fix this.

@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (01dabf4) 93.46% compared to head (0d6c1fb) 93.46%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3054   +/-   ##
========================================
  Coverage    93.46%   93.46%           
========================================
  Files           66       66           
  Lines        14007    14011    +4     
========================================
+ Hits         13091    13095    +4     
  Misses         916      916           
Files Coverage Δ
botocore/client.py 97.68% <100.00%> (+<0.01%) ⬆️
botocore/parsers.py 98.62% <100.00%> (+<0.01%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nateprewitt nateprewitt requested a review from SamRemis November 11, 2023 19:45
@nateprewitt nateprewitt merged commit 50861b9 into boto:develop Nov 11, 2023
SamRemis added a commit to SamRemis/botocore that referenced this pull request Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants