Commit a56af241 authored by cduvall@chromium.org's avatar cduvall@chromium.org

Extensions Docs Server: Uniform handling of file not found errors

All the FileSystem implementations now handle missing files the same way (by
throwing a FileNotFoundError).

BUG=141664

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=151078

Review URL: https://chromiumcodereview.appspot.com/10830252

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151319 0039d316-1c4b-4281-b951-d872f2087c98
parent 54cc5396
......@@ -98,6 +98,5 @@ class APIDataSource(object):
return self._GenerateHandlebarContext(key,
self._idl_cache.GetFromFile(self._base_path + '/' + idl_path),
path)
except FileNotFoundError as e:
logging.error(e)
except FileNotFoundError:
raise
......@@ -62,5 +62,4 @@ class APIListDataSource(object):
try:
return self._cache.GetFromFileListing(self._api_path)[key]
except FileNotFoundError as e:
logging.error(e)
return None
raise ValueError(str(e) + ': Error listing files for "%s".' % key)
......@@ -303,7 +303,7 @@ def _MoveSingleFile(source_dir,
static_data is not None)
static_file = os.path.join(intros_dest, processed_name + '.html')
else:
template_data = _MakeArticleTemplate(unix_name, path)
template_data = _MakeArticleTemplate(processed_name, path)
static_file = os.path.join(articles_dest, processed_name + '.html')
if replace or not os.path.exists(template_file):
_WriteFile(template_file, template_data)
......
......@@ -82,5 +82,4 @@ class IntroDataSource(object):
return self._cache.GetFromFile(base_path + '/' + real_path)
except FileNotFoundError as error:
pass
logging.error(error)
return None
raise ValueError(str(error) + ': No intro found for "%s".' % key)
{{+partials.standard_apps_article article:intros.content_security_policy}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.contentSecurityPolicy}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_context_menus}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_contextMenus}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_devtools_inspected_window}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_devtools_inspectedWindow}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_input_ui}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_inputUI}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_web_inspector}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_webInspector}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_web_inspector_audits}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_webInspector_audits}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_web_inspector_panels}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_webInspector_panels}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_web_inspector_resources}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.experimental_webInspector_resources}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.manifest_version}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.manifestVersion}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.sandboxing_eval}}
\ No newline at end of file
{{+partials.standard_apps_article article:intros.sandboxingEval}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.content_security_policy}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.contentSecurityPolicy}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_browsing_data}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_browsingData}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_content_settings}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_contentSettings}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_context_menus}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_contextMenus}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_devtools_inspected_window}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_devtools_inspectedWindow}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_input_ui}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_inputUI}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_web_inspector}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_webInspector}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_web_inspector_audits}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_webInspector_audits}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_web_inspector_panels}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_webInspector_panels}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_web_inspector_resources}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_webInspector_resources}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_web_request}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.experimental_webRequest}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.manifest_version}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.manifestVersion}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.sandboxing_eval}}
\ No newline at end of file
{{+partials.standard_extensions_article article:intros.sandboxingEval}}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment