Bug 1455378 Give an informative error message of you try to ./mach pastebin too large a file. r=gps
authorTom Ritter <tom@mozilla.com>
Thu, 19 Apr 2018 17:31:00 +0000
changeset 471456 ea15ffd7e5e84f409827184173fae6f6abda1add
parent 471455 1f335f111475d1623920835e38ceebda8214ef2e
child 471457 804f8b73b13a0bcf3432df7a7eb692759a292d15
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1455378
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1455378 Give an informative error message of you try to ./mach pastebin too large a file. r=gps
tools/mach_commands.py
--- a/tools/mach_commands.py
+++ b/tools/mach_commands.py
@@ -146,17 +146,24 @@ class PastebinProvider(object):
 
         data = urllib.urlencode(params)
         print('Uploading ...')
         try:
             req = urllib2.Request(URL, data)
             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))
         except urllib2.URLError:
             print('ERROR. Could not connect to pastebin.mozilla.org.')
             return 1
         return 0