Bug 1455378 Give an informative error message of you try to ./mach pastebin too large a file. r=gps

--HG--
extra : rebase_source : 719fb33701b159955494031708d9366a57b31f9a
This commit is contained in:
Tom Ritter 2018-04-19 17:31:00 +00:00
parent 70e1c57e9b
commit 8728bdccf7

View File

@ -151,7 +151,14 @@ class PastebinProvider(object):
response = urllib2.urlopen(req)
http_response_code = response.getcode()
if http_response_code == 200:
print(response.geturl())
pasteurl = response.geturl()
if pasteurl == URL:
if "Query failure: Data too long for column" in response.readline():
print('ERROR. Request too large. Limit is 64KB.')
else:
print('ERROR. Unknown error')
else:
print(pasteurl)
else:
print('Could not upload the file, '
'HTTP Response Code %s' % (http_response_code))