Skip to content

Commit

Permalink
adding traceback for the error
Browse files Browse the repository at this point in the history
  • Loading branch information
BabaYaga1221 committed May 5, 2023
1 parent 20dffb1 commit ab116b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rocker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def get_docker_client():
def docker_build(docker_client = None, output_callback = None, **kwargs):
image_id = None
build_success = False
build_output = []

if not docker_client:
docker_client = get_docker_client()
Expand All @@ -148,9 +149,10 @@ def docker_build(docker_client = None, output_callback = None, **kwargs):
continue
if output_callback is not None:
output_callback(output)
build_output.append(output)

if "error" in output.lower():
raise Exception(f"Build failed: {output}")
raise Exception("Build failed")

match = re.match(r'Successfully built ([a-z0-9]{12})', output)
if match:
Expand All @@ -160,7 +162,7 @@ def docker_build(docker_client = None, output_callback = None, **kwargs):
if build_success:
return image_id
else:
raise Exception(f"Build failed: {output}")
raise Exception("Build failed: "+"\n".join(build_output))


class SIGWINCHPassthrough(object):
Expand Down

0 comments on commit ab116b4

Please sign in to comment.