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

Side by Side Diff: chrome/common/extensions/docs/server2/api_data_source.py

Issue 10830252: Extensions Docs Server: Uniform handling of file not found errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better error handling/slight template fix to pass integration_test 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/api_list_data_source.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 import logging 6 import logging
7 import os 7 import os
8 8
9 from file_system import FileNotFoundError 9 from file_system import FileNotFoundError
10 from handlebar_dict_generator import HandlebarDictGenerator 10 from handlebar_dict_generator import HandlebarDictGenerator
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 idl_path = unix_name + '.idl' 91 idl_path = unix_name + '.idl'
92 try: 92 try:
93 return self._GenerateHandlebarContext(key, 93 return self._GenerateHandlebarContext(key,
94 self._json_cache.GetFromFile(self._base_path + '/' + json_path), 94 self._json_cache.GetFromFile(self._base_path + '/' + json_path),
95 path) 95 path)
96 except FileNotFoundError: 96 except FileNotFoundError:
97 try: 97 try:
98 return self._GenerateHandlebarContext(key, 98 return self._GenerateHandlebarContext(key,
99 self._idl_cache.GetFromFile(self._base_path + '/' + idl_path), 99 self._idl_cache.GetFromFile(self._base_path + '/' + idl_path),
100 path) 100 path)
101 except FileNotFoundError as e: 101 except FileNotFoundError:
102 logging.error(e)
103 raise 102 raise
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/api_list_data_source.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698