File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -166,18 +166,21 @@ def build(self, **kwargs):
166
166
resp = self .client .api .build (** kwargs )
167
167
if isinstance (resp , six .string_types ):
168
168
return self .get (resp )
169
+ last_event = None
169
170
for chunk in json_stream (resp ):
170
171
if 'error' in chunk :
171
172
raise BuildError (chunk ['error' ])
172
- break
173
173
if 'stream' in chunk :
174
- match = re .search (r'(Successfully built |sha256:)([0-9a-f]+)' ,
175
- chunk ['stream' ])
174
+ match = re .search (
175
+ r'(Successfully built |sha256:)([0-9a-f]+)' ,
176
+ chunk ['stream' ]
177
+ )
176
178
if match :
177
179
image_id = match .group (2 )
178
180
return self .get (image_id )
181
+ last_event = chunk
179
182
180
- return BuildError ('Unknown' )
183
+ raise BuildError (last_event or 'Unknown' )
181
184
182
185
def get (self , name ):
183
186
"""
You can’t perform that action at this time.
0 commit comments