bug 1168535 - print error response body in upload_symbols.py. r=gps

This commit is contained in:
Ted Mielczarek 2015-05-27 13:50:04 -04:00
parent 5aa3c9df74
commit 4f65f3f57f
2 changed files with 14 additions and 7 deletions

View File

@ -254,7 +254,7 @@ endif # MOZ_CRASHREPORTER
uploadsymbols:
ifdef MOZ_CRASHREPORTER
ifdef SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE
$(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
$(PYTHON) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
else
$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
endif

View File

@ -62,15 +62,22 @@ def main():
if r.status_code >= 200 and r.status_code < 300:
print('Uploaded successfully!')
elif r.status_code < 400:
print('Error: bad auth token? ({0})'.format(r.status_code),
return 0
if r.status_code < 400:
print('Error: bad auth token? ({0}: {1})'.format(r.status_code,
r.reason),
file=sys.stderr)
return 1
else:
print('Error: got HTTP response {0}'.format(r.status_code),
print('Error: got HTTP response {0}: {1}'.format(r.status_code,
r.reason),
file=sys.stderr)
return 1
return 0
print('Response body:\n{sep}\n{body}\n{sep}\n'.format(
sep='=' * 20,
body=r.text
))
return 1
if __name__ == '__main__':
sys.exit(main())