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

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

Issue 10854054: Extensions Docs Server: Fix handling of nodocs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
Index: chrome/common/extensions/docs/server2/handlebar_dict_generator.py
diff --git a/chrome/common/extensions/docs/server2/handlebar_dict_generator.py b/chrome/common/extensions/docs/server2/handlebar_dict_generator.py
index 08f0a2904c17a504ff32d76212771fb46bcdb1af..8613d8515b2c674a0030fcc33104d531f07e5eda 100644
--- a/chrome/common/extensions/docs/server2/handlebar_dict_generator.py
+++ b/chrome/common/extensions/docs/server2/handlebar_dict_generator.py
@@ -9,6 +9,9 @@ import os
from docs_server_utils import GetLinkToRefType
import third_party.json_schema_compiler.model as model
+class NoDocError(Exception):
+ pass
+
def _RemoveNoDocs(item):
if type(item) == dict:
if item.get('nodoc', False):
@@ -34,7 +37,8 @@ class HandlebarDictGenerator(object):
"""
def __init__(self, json):
clean_json = copy.deepcopy(json)
- _RemoveNoDocs(clean_json)
+ if _RemoveNoDocs(clean_json):
+ raise NoDocError()
not at google - send to devlin 2012/08/09 05:11:36 I don't think an exception is the answer here. We
cduvall 2012/08/09 17:54:05 Done.
try:
self._namespace = model.Namespace(clean_json, clean_json['namespace'])
except Exception as e:
not at google - send to devlin 2012/08/09 05:11:36 why do we need to log this error rather than handl
cduvall 2012/08/09 17:54:05 Done.

Powered by Google App Engine
This is Rietveld 408576698