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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js

Issue 2116563003: [DevTools] Report unhandled exceptions and promise rejections through Runtime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests pass Created 4 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: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
index c83a4fa67a2597511dc650d7421fe9c6b2c13c81..fe85fc8c0a7f051af56b051669ed1349f1baf0cf 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -339,6 +339,62 @@ WebInspector.RuntimeDispatcher.prototype = {
/**
* @override
+ * @param {number} exceptionId
+ * @param {number} timestamp
+ * @param {!RuntimeAgent.ExceptionDetails} details
+ * @param {!RuntimeAgent.RemoteObject=} exception
+ * @param {number=} executionContextId
+ */
+ exceptionUnhandled: function(exceptionId, timestamp, details, exception, executionContextId)
+ {
+ var consoleMessage = new WebInspector.ConsoleMessage(
+ this._runtimeModel.target(),
+ WebInspector.ConsoleMessage.MessageSource.JS,
+ WebInspector.ConsoleMessage.MessageLevel.Error,
+ details.text,
+ undefined,
+ details.url,
+ details.line,
+ details.column,
+ undefined,
+ exception ? ["Uncaught (in promise)", exception] : undefined,
+ details.stack,
+ timestamp * 1000, // Convert to ms.
+ executionContextId,
+ details.scriptId);
+ consoleMessage.setExceptionId(exceptionId);
+ this._runtimeModel.target().consoleModel.addMessage(consoleMessage);
+ },
+
+ /**
+ * @override
+ * @param {number} timestamp
+ * @param {string} message
+ * @param {number} revokedExceptionId
+ */
+ exceptionRevoked: function(timestamp, message, revokedExceptionId)
+ {
+ var consoleMessage = new WebInspector.ConsoleMessage(
+ this._runtimeModel.target(),
+ WebInspector.ConsoleMessage.MessageSource.JS,
+ WebInspector.ConsoleMessage.MessageLevel.RevokedError,
+ message,
+ undefined,
+ undefined,
+ undefined,
+ undefined,
+ undefined,
+ [],
kozy 2016/07/08 18:48:59 [] -> undefined?
dgozman 2016/07/08 18:56:41 Done.
+ undefined,
+ timestamp * 1000, // Convert to ms.
+ undefined,
+ undefined);
+ consoleMessage.setRevokedExceptionId(revokedExceptionId);
+ this._runtimeModel.target().consoleModel.addMessage(consoleMessage);
+ },
+
+ /**
+ * @override
* @param {!RuntimeAgent.RemoteObject} payload
* @param {!Object=} hints
*/

Powered by Google App Engine
This is Rietveld 408576698