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

Side by Side Diff: chrome/browser/resources/device_log_ui/device_log_ui.js

Issue 1643513002: Catch exception when creating device log entries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added No log entries to container Created 4 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 var DeviceLogUI = (function() { 5 var DeviceLogUI = (function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Creates a tag for the log level. 9 * Creates a tag for the log level.
10 * 10 *
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 container.appendChild(entry); 88 container.appendChild(entry);
89 } 89 }
90 }; 90 };
91 91
92 /** 92 /**
93 * Callback function, triggered when the log is received. 93 * Callback function, triggered when the log is received.
94 * 94 *
95 * @param {Object} data A JSON structure of event log entries. 95 * @param {Object} data A JSON structure of event log entries.
96 */ 96 */
97 var getLogCallback = function(data) { 97 var getLogCallback = function(data) {
98 createEventLog(JSON.parse(data)); 98 try {
99 createEventLog(JSON.parse(data));
100 } catch(e) {
101 var container = $('log-container');
102 container.textContent = 'No log entries';
103 }
99 }; 104 };
100 105
101 /** 106 /**
102 * Requests a log update. 107 * Requests a log update.
103 */ 108 */
104 var requestLog = function() { 109 var requestLog = function() {
105 chrome.send('DeviceLog.getLog'); 110 chrome.send('DeviceLog.getLog');
106 }; 111 };
107 112
108 /** 113 /**
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 checkboxes[i].onclick = requestLog; 145 checkboxes[i].onclick = requestLog;
141 146
142 setRefresh(); 147 setRefresh();
143 requestLog(); 148 requestLog();
144 }); 149 });
145 150
146 return { 151 return {
147 getLogCallback: getLogCallback 152 getLogCallback: getLogCallback
148 }; 153 };
149 })(); 154 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698