Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Better log for cancelled build
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Jun 16, 2017
1 parent 0ccb85a commit a50c39e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion badwolf/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,12 @@ def run_in_container(self, docker_image_name):
container.remove(force=True)
except NotFound:
pass
except (APIError, DockerException, ReadTimeout):
except APIError as api_e:
if 'can not get logs from container which is dead or marked for removal' in str(api_e):
output.append('Build cancelled')
else:
logger.exception('Error removing docker container')
except (DockerException, ReadTimeout):
logger.exception('Error removing docker container')

return exit_code, ''.join(output)
Expand Down

0 comments on commit a50c39e

Please sign in to comment.