Bug 1374917 - Convert exception messages from the requests module before logging them. r?gps
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1789,17 +1789,18 @@ class PackageFrontend(MachCommandBase):
# The relengapi proxy likes to return error 400 bad request
# which seems improbably to be due to our (simple) GET
# being borked.
should_retry = status >= 500 or status == 400
if should_retry or attempt < retry:
level = logging.WARN
else:
level = logging.ERROR
- self.log(level, 'artifact', {}, e.message)
+ # e.message is not always a string, so convert it first.
+ self.log(level, 'artifact', {}, str(e.message))
if not should_retry:
break
if attempt < retry:
self.log(logging.INFO, 'artifact', {},
'Will retry in a moment...')
continue
try:
valid = record.validate()