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

Side by Side Diff: chrome/browser/resources/google_now/utility.js

Issue 23664005: Adding error message to error string (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * @fileoverview Utility objects and functions for Google Now extension. 8 * @fileoverview Utility objects and functions for Google Now extension.
9 * Most important entities here: 9 * Most important entities here:
10 * (1) 'wrapper' is a module used to add error handling and other services to 10 * (1) 'wrapper' is a module used to add error handling and other services to
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // topFrameElements is an array that ends like: 107 // topFrameElements is an array that ends like:
108 // [N-3] //pmofbkohncoogjjhahejjfbppikbjigm/utility.js 108 // [N-3] //pmofbkohncoogjjhahejjfbppikbjigm/utility.js
109 // [N-2] 308 109 // [N-2] 308
110 // [N-1] 19 110 // [N-1] 19
111 if (topFrameElements.length >= 3) { 111 if (topFrameElements.length >= 3) {
112 file = topFrameElements[topFrameElements.length - 3]; 112 file = topFrameElements[topFrameElements.length - 3];
113 line = topFrameElements[topFrameElements.length - 2]; 113 line = topFrameElements[topFrameElements.length - 2];
114 } 114 }
115 } 115 }
116 116
117 var errorText = encodeURIComponent(error.name);
118 if (error.canSendMessageToServer)
119 errorText = errorText + ': ' + error.message;
arv (Not doing code reviews) 2013/09/03 17:01:30 What about the message? Is it already encoded?
vadimt 2013/09/03 17:58:44 Gosh
120
117 var requestParameters = 121 var requestParameters =
118 'error=' + encodeURIComponent(error.name) + 122 'error=' + errorText +
119 '&script=' + encodeURIComponent(file) + 123 '&script=' + encodeURIComponent(file) +
120 '&line=' + encodeURIComponent(line) + 124 '&line=' + encodeURIComponent(line) +
121 '&trace=' + encodeURIComponent(filteredStack); 125 '&trace=' + encodeURIComponent(filteredStack);
122 var request = buildServerRequest('jserror', 126 var request = buildServerRequest('jserror',
123 'application/x-www-form-urlencoded'); 127 'application/x-www-form-urlencoded');
124 request.onloadend = function(event) { 128 request.onloadend = function(event) {
125 console.log('sendErrorReport status: ' + request.status); 129 console.log('sendErrorReport status: ' + request.status);
126 }; 130 };
127 request.send(requestParameters); 131 request.send(requestParameters);
128 } 132 }
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 // Poll for the sign in state every hour. 726 // Poll for the sign in state every hour.
723 // One hour is just an arbitrary amount of time chosen. 727 // One hour is just an arbitrary amount of time chosen.
724 chrome.alarms.create(alarmName, {periodInMinutes: 60}); 728 chrome.alarms.create(alarmName, {periodInMinutes: 60});
725 729
726 return { 730 return {
727 addListener: addListener, 731 addListener: addListener,
728 isSignedIn: isSignedIn, 732 isSignedIn: isSignedIn,
729 removeToken: removeToken 733 removeToken: removeToken
730 }; 734 };
731 } 735 }
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