Skip to content

Commit

Permalink
Python 3 compatibility error handling: use to_native(e) instead of st…
Browse files Browse the repository at this point in the history
…r(e) or e.me… (ansible-collections#26)

* Py3 compat error handling: use to_native(e) instead of str(e) or e.message
* PR comment changes, use fail_json_aws and is_boto3_error_code

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@ffe14f9
  • Loading branch information
veloutin authored and jillr committed Jul 28, 2021
1 parent b0ec092 commit 9810aee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/modules/ec2_vpc_route_table_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def list_ec2_vpc_route_tables(connection, module):
try:
all_route_tables = connection.get_all_route_tables(filters=filters)
except BotoServerError as e:
module.fail_json(msg=e.message)
module.fail_json_aws(e, msg="Failed to get route tables")

for route_table in all_route_tables:
route_table_dict_array.append(get_route_table_info(route_table))
Expand Down

0 comments on commit 9810aee

Please sign in to comment.