Skip to content

Commit

Permalink
Merge pull request #2538 from cariad/develop
Browse files Browse the repository at this point in the history
Fix example `if` statements (#1)
  • Loading branch information
nateprewitt committed Aug 24, 2020
2 parents 256099a + a3b3cc1 commit a708a5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/guide/error-handling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Using Amazon Kinesis as an example service, you can use Boto3 to catch the excep
client.describe_stream(StreamName='myDataStream')
except botocore.exceptions.ClientError as error:
if error.response['Error']['Code'] == 'LimitExceededException'
if error.response['Error']['Code'] == 'LimitExceededException':
logger.warn('API call limit exceeded; backing off and retrying...')
else:
raise error
Expand Down Expand Up @@ -262,7 +262,7 @@ Using a low-level Amazon SQS client, here’s an example of catching a generic o
client.send_message(QueueUrl=queue_url, MessageBody=('some_message')
except botocore.exceptions.ClientError as err:
if err.response['Error']['Code'] == 'InternalError' # Generic error
if err.response['Error']['Code'] == 'InternalError': # Generic error
# We grab the message, request ID, and HTTP code to give to customer support
print('Error Message: {}'.format(err.response['Error']['Message']))
print('Request ID: {}'.format(err.response['ResponseMetadata']['RequestId']))
Expand Down

0 comments on commit a708a5a

Please sign in to comment.