Skip to content

Commit

Permalink
Merge 7f28e26 into a587737
Browse files Browse the repository at this point in the history
  • Loading branch information
kdsudac committed Jan 29, 2020
2 parents a587737 + 7f28e26 commit c2340ff
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions openhtf/output/callbacks/mfg_inspector.py
Expand Up @@ -43,11 +43,15 @@ def _send_mfg_inspector_request(envelope_data, credentials, destination_url):
logging.warning('Upload failed with response %s: %s', resp, content)
raise UploadFailedError(resp, content)

if resp.status != 200:
logging.warning('Upload failed: %s', result)
raise UploadFailedError(result['error'], result)

return result
if resp.status == 200:
return result

message = '%s: %s' % (result.get('error',
'UNKNOWN_ERROR'), result.get('message'))
if resp.status == 400:
raise InvalidTestRunError(message)
else:
raise UploadFailedError(message)


def send_mfg_inspector_data(inspector_proto, credentials, destination_url):
Expand Down

0 comments on commit c2340ff

Please sign in to comment.