Index: chrome/common/extensions/docs/server2/compiled_file_system.py |
diff --git a/chrome/common/extensions/docs/server2/compiled_file_system.py b/chrome/common/extensions/docs/server2/compiled_file_system.py |
index 051572b130102728b49a61515fb91c7890738733..8fdc70345d98be15c4553500ea83b0300f2cc7ae 100644 |
--- a/chrome/common/extensions/docs/server2/compiled_file_system.py |
+++ b/chrome/common/extensions/docs/server2/compiled_file_system.py |
@@ -2,6 +2,8 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+import logging |
+ |
class _CacheEntry(object): |
def __init__(self, cache_data, version): |
self._cache_data = cache_data |
@@ -92,11 +94,17 @@ class CompiledFileSystem(object): |
cache_entry = self._file_object_store.Get(path, time=0).Get() |
if (cache_entry is not None) and (version == cache_entry.version): |
return cache_entry._cache_data |
- cache_data = self._populate_function( |
- path, |
- self._file_system.ReadSingle(path, binary=binary)) |
- self._file_object_store.Set(path, _CacheEntry(cache_data, version), time=0) |
- return cache_data |
+ try: |
+ cache_data = self._populate_function( |
+ path, |
+ self._file_system.ReadSingle(path, binary=binary)) |
+ self._file_object_store.Set(path, |
+ _CacheEntry(cache_data, version), |
+ time=0) |
+ return cache_data |
+ except ValueError as e: |
+ logging.error('Could not get data for the file at %s: %s' % (path, e)) |
+ return None |
def GetFromFileListing(self, path): |
"""Calls |populate_function| on the listing of the files at |path|. |