mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 03:46:55 +00:00
Fix error handling. (#546)
This commit is contained in:
@@ -295,7 +295,7 @@ def main():
|
||||
except NotFound:
|
||||
client.fail('Could not find container "{0}"'.format(container))
|
||||
except APIError as e:
|
||||
if e.response and e.response.status_code == 409:
|
||||
if e.response is not None and e.response.status_code == 409:
|
||||
client.fail('The container "{0}" has been paused ({1})'.format(container, to_native(e)))
|
||||
client.fail('An unexpected Docker error occurred: {0}'.format(to_native(e)), exception=traceback.format_exc())
|
||||
except DockerException as e:
|
||||
|
||||
Reference in New Issue
Block a user