Jim MacArthur pushed to branch jmac/remote_execution_rebase at BuildStream / buildstream
Commits:
-
9ed89fcb
by Jim MacArthur at 2018-08-15T14:31:14Z
1 changed file:
Changes:
... | ... | @@ -180,9 +180,18 @@ class SandboxRemote(Sandbox): |
180 | 180 |
if source_push_successful or cascache.verify_key_pushed(ref, self._get_project()):
|
181 | 181 |
response = self.__run_remote_command(cascache, command, upload_vdir.ref, env)
|
182 | 182 |
|
183 |
- if response is None or response.HasField("error"):
|
|
184 |
- # Build failed, so return a failure code
|
|
185 |
- return 1
|
|
183 |
+ if response is None:
|
|
184 |
+ # Failure of remote execution, usually due to an error in BuildStream
|
|
185 |
+ # NB This error could be raised in __run_remote_command
|
|
186 |
+ raise SandboxError("No response returned from server")
|
|
187 |
+ |
|
188 |
+ assert(response.HasField("error") or response.HasField("response"))
|
|
189 |
+ |
|
190 |
+ if response.HasField("error"):
|
|
191 |
+ # A normal error during the build
|
|
192 |
+ error_message = response.error.message
|
|
193 |
+ # response.error also contains 'details' (iterator of Any) which we ignore at the moment.
|
|
194 |
+ return response.error.code
|
|
186 | 195 |
else:
|
187 | 196 |
|
188 | 197 |
# At the moment, response can either be an
|