Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5304)

Unified Diff: chrome/common/extensions/docs/server2/branch_utility.py

Issue 11744027: Extension docs server: assume everything is "trunk" if the branch can't be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/branch_utility.py
diff --git a/chrome/common/extensions/docs/server2/branch_utility.py b/chrome/common/extensions/docs/server2/branch_utility.py
index ba4125f99e16158fc59f4b0f588bba46a9b9a01b..0053d17e82bd6914bce281fec3d83f8e3d625985 100644
--- a/chrome/common/extensions/docs/server2/branch_utility.py
+++ b/chrome/common/extensions/docs/server2/branch_utility.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import json
+import logging
import object_store
import operator
@@ -51,8 +52,15 @@ class BranchUtility(object):
if branch_number is not None:
return branch_number
- fetch_data = self._fetcher.Fetch(self._base_path).content
- version_json = json.loads(fetch_data)
+ try:
+ version_json = json.loads(self._fetcher.Fetch(self._base_path).content)
+ except Exception as e:
+ # This can happen if omahaproxy is misbehaving, which we've seen before.
+ # Quick hack fix: just serve from trunk until it's fixed.
+ logging.error('Failed to fetch or parse branch from omahaproxy: %s! '
+ 'Falling back to "trunk".' % e)
+ return 'trunk'
+
branch_numbers = {}
for entry in version_json:
if entry['os'] not in ['win', 'linux', 'mac', 'cros']:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698