Bug 1151521 - make logs less scary when non-JSON responses are received. r=adw
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 07 Apr 2015 15:14:56 +1000
changeset 237975 bf76e4b4c179ab70a337731bd27d5464195749b2
parent 237974 fd2dfe2228b621322fe25fc84e5aa294ac090031
child 237976 3a6dfc65f76b02f3a19dde14cb2eeaa5368648a0
push id58080
push userryanvm@gmail.com
push dateTue, 07 Apr 2015 20:23:52 +0000
treeherdermozilla-inbound@105106bde936 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1151521
milestone40.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 1151521 - make logs less scary when non-JSON responses are received. r=adw
browser/components/readinglist/ServerClient.jsm
--- a/browser/components/readinglist/ServerClient.jsm
+++ b/browser/components/readinglist/ServerClient.jsm
@@ -139,18 +139,18 @@ ServerClient.prototype = {
           status: response.status,
           headers: response.headers
         };
         try {
           if (response.body) {
             result.body = JSON.parse(response.body);
           }
         } catch (e) {
-          log.info("Failed to parse JSON body |${body}|: ${e}",
-                    {body: response.body, e});
+          log.debug("Response is not JSON. First 1024 chars: |${body}|",
+                    { body: response.body.substr(0, 1024) });
           // We don't reject due to this (and don't even make a huge amount of
           // log noise - eg, a 50X error from a load balancer etc may not write
           // JSON.
         }
 
         resolve(result);
       }
       // We are assuming the body has already been decoded and thus contains