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

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

Issue 82433002: Docserver: Further refactoring to the new GithubFileSystem to make it update (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix test data Created 7 years, 1 month 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
Index: chrome/common/extensions/docs/server2/file_system.py
diff --git a/chrome/common/extensions/docs/server2/file_system.py b/chrome/common/extensions/docs/server2/file_system.py
index 91fe50ddaad71c9c2a1105beab5a84e071e74875..d838d5ac06b79076ff724c2a5da3a69cbfbd8d2c 100644
--- a/chrome/common/extensions/docs/server2/file_system.py
+++ b/chrome/common/extensions/docs/server2/file_system.py
@@ -5,19 +5,29 @@
from future import Gettable, Future
-class FileNotFoundError(Exception):
+class _BaseFileSystemException(Exception):
+ def __init__(self, message):
+ Exception.__init__(self, message)
+
+ @classmethod
+ def RaiseInFuture(cls, message):
+ def boom(): raise cls(message)
+ return Future(delegate=Gettable(boom))
+
+
+class FileNotFoundError(_BaseFileSystemException):
'''Raised when a file isn't found for read or stat.
'''
def __init__(self, filename):
- Exception.__init__(self, filename)
+ _BaseFileSystemException.__init__(self, filename)
-class FileSystemError(Exception):
+class FileSystemError(_BaseFileSystemException):
'''Raised on when there are errors reading or statting files, such as a
network timeout.
'''
def __init__(self, filename):
- Exception.__init__(self, filename)
+ _BaseFileSystemException.__init__(self, filename)
class StatInfo(object):
« no previous file with comments | « chrome/common/extensions/docs/server2/fake_fetchers.py ('k') | chrome/common/extensions/docs/server2/github_file_system.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698