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

--HG--
extra : rebase_source : 7838dc42440eca1df2cbb98fce06fdb131b678b5
This commit is contained in:
Ted Mielczarek 2015-05-27 13:50:04 -04:00
Родитель 563c609fd0
Коммит 9c7373d53a
2 изменённых файлов: 14 добавлений и 7 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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())