[Notes] [Git][BuildStream/buildstream][jmac/remote_execution_rebase] _sandboxremote.py: Better handling of reponse codes



Title: GitLab

Jim MacArthur pushed to branch jmac/remote_execution_rebase at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • buildstream/sandbox/_sandboxremote.py
    ... ... @@ -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
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]