Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/template_data_source.py |
| diff --git a/chrome/common/extensions/docs/server2/template_data_source.py b/chrome/common/extensions/docs/server2/template_data_source.py |
| index dcd81c4ffcccf066cc75bcfb42ccf906eefb5e60..2015089c8c73e38f483e4ceb890f14b897693884 100644 |
| --- a/chrome/common/extensions/docs/server2/template_data_source.py |
| +++ b/chrome/common/extensions/docs/server2/template_data_source.py |
| @@ -6,6 +6,7 @@ import logging |
| from docs_server_utils import FormatKey |
| from third_party.handlebar import Handlebar |
| +from handlebar_dict_generator import NoDocError |
| EXTENSIONS_URL = '/chrome/extensions' |
| @@ -103,17 +104,20 @@ class TemplateDataSource(object): |
| if not template: |
| return '' |
| # TODO error handling |
| - return template.render({ |
| - 'api_list': self._api_list_data_source, |
| - 'apis': self._api_data_source, |
| - 'branchInfo': self._branch_info, |
| - 'intros': self._intro_data_source, |
| - 'partials': self, |
| - 'samples': self._samples_data_source, |
| - 'static': self._static_resources, |
| - 'true': True, |
| - 'false': False |
| - }).text |
| + try: |
| + return template.render({ |
| + 'api_list': self._api_list_data_source, |
| + 'apis': self._api_data_source, |
| + 'branchInfo': self._branch_info, |
| + 'intros': self._intro_data_source, |
| + 'partials': self, |
| + 'samples': self._samples_data_source, |
| + 'static': self._static_resources, |
| + 'true': True, |
| + 'false': False |
| + }).text |
| + except NoDocError: |
| + return '' |
|
not at google - send to devlin
2012/08/09 05:11:36
See comment in handlebar_dict_generator.py. This f
cduvall
2012/08/09 17:54:05
Done.
|
| def __getitem__(self, key): |
| return self.get(key) |