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

Unified Diff: Source/devtools/front_end/console/ConsoleView.js

Issue 369333002: DevTools: Added error message when the command is invoked from the console with exception (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@add-evaluate-exception-details
Patch Set: Created 6 years, 5 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: Source/devtools/front_end/console/ConsoleView.js
diff --git a/Source/devtools/front_end/console/ConsoleView.js b/Source/devtools/front_end/console/ConsoleView.js
index 01ff99e265ad73d93ab252671e0094c9d528b36f..45ab5e31deca9b7c5f311e29a95054cb39ed5573 100644
--- a/Source/devtools/front_end/console/ConsoleView.js
+++ b/Source/devtools/front_end/console/ConsoleView.js
@@ -788,8 +788,9 @@ WebInspector.ConsoleView.prototype = {
* @param {?WebInspector.RemoteObject} result
* @param {boolean} wasThrown
* @param {!WebInspector.ConsoleMessage} originatingConsoleMessage
+ * @param {?DebuggerAgent.ExceptionDetails=} exceptionDetails
*/
- _printResult: function(result, wasThrown, originatingConsoleMessage)
+ _printResult: function(result, wasThrown, originatingConsoleMessage, exceptionDetails)
{
if (!result)
return;
@@ -806,6 +807,21 @@ WebInspector.ConsoleView.prototype = {
var message = new WebInspector.ConsoleMessage(target, WebInspector.ConsoleMessage.MessageSource.JS, level, "", WebInspector.ConsoleMessage.MessageType.Result, url, lineNumber, columnNumber, undefined, [result]);
message.setOriginatingMessage(originatingConsoleMessage);
target.consoleModel.addMessage(message);
+ if (wasThrown) {
+ var errorMessage = new WebInspector.ConsoleMessage(
+ target,
+ WebInspector.ConsoleMessage.MessageSource.JS,
+ level,
+ exceptionDetails.text,
+ undefined,
+ exceptionDetails.url,
+ exceptionDetails.line,
+ exceptionDetails.column,
+ undefined,
+ undefined,
+ exceptionDetails.stackTrace);
+ target.consoleModel.addMessage(errorMessage);
+ }
}
if (result.type !== "function") {
@@ -860,7 +876,7 @@ WebInspector.ConsoleView.prototype = {
var data = /**{{result: ?WebInspector.RemoteObject, wasThrown: boolean, text: string, commandMessage: !WebInspector.ConsoleMessage}} */ (event.data);
this._prompt.pushHistoryItem(data.text);
WebInspector.settings.consoleHistory.set(this._prompt.historyData.slice(-30));
- this._printResult(data.result, data.wasThrown, data.commandMessage);
+ this._printResult(data.result, data.wasThrown, data.commandMessage, data.exceptionDetails);
},
/**

Powered by Google App Engine
This is Rietveld 408576698