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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/inspector_backend_list.py

Issue 449753002: Improve error reporting when indexing tab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments explain what to do with exceptions Created 6 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: tools/telemetry/telemetry/core/backends/chrome/inspector_backend_list.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/inspector_backend_list.py b/tools/telemetry/telemetry/core/backends/chrome/inspector_backend_list.py
index 2f7385ee197d89bb8cb0692afaa8472b00933932..9301030b791ca760b9b236729270fcb0c57903f9 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/inspector_backend_list.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/inspector_backend_list.py
@@ -45,11 +45,10 @@ class InspectorBackendList(collections.Sequence):
def __getitem__(self, index):
self._Update()
if index >= len(self._inspectable_contexts_dict.keys()):
- logging.error('About to explode: _inspectable_contexts_dict.keys() = %s',
- repr({
- "index": index,
- "keys": self._inspectable_contexts_dict.keys()
- }))
+ raise IndexError(
+ 'About to explode: _inspectable_contexts_dict.keys() = %s,'
+ '"index": %i' % (
+ repr(self._inspectable_contexts_dict.keys()), index))
context_id = self._inspectable_contexts_dict.keys()[index]
if context_id not in self._inspector_backend_dict:
backend = inspector_backend.InspectorBackend(

Powered by Google App Engine
This is Rietveld 408576698