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

Unified Diff: extensions/renderer/api_last_error.cc

Issue 2819683002: [Extenisons Bindings] Don't throw unchecked errors; add console errors (Closed)
Patch Set: jbroman's Created 3 years, 8 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
« no previous file with comments | « extensions/renderer/api_last_error.h ('k') | extensions/renderer/api_last_error_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/api_last_error.cc
diff --git a/extensions/renderer/api_last_error.cc b/extensions/renderer/api_last_error.cc
index 4073d276c09a526981cceb2d58fc5737e0e3319d..ece0de11dd2de4d988d0f70654a7eb3658a93094 100644
--- a/extensions/renderer/api_last_error.cc
+++ b/extensions/renderer/api_last_error.cc
@@ -53,8 +53,9 @@ gin::WrapperInfo LastErrorObject::kWrapperInfo = {gin::kEmbedderNativeGin};
} // namespace
-APILastError::APILastError(const GetParent& get_parent)
- : get_parent_(get_parent) {}
+APILastError::APILastError(const GetParent& get_parent,
+ const AddConsoleError& add_console_error)
+ : get_parent_(get_parent), add_console_error_(add_console_error) {}
APILastError::APILastError(APILastError&& other) = default;
APILastError::~APILastError() = default;
@@ -133,8 +134,8 @@ void APILastError::ClearError(v8::Local<v8::Context> context,
}
if (report_if_unchecked && !last_error->accessed()) {
- isolate->ThrowException(
- v8::Exception::Error(gin::StringToV8(isolate, last_error->error())));
+ add_console_error_.Run(
+ context, "Unchecked runtime.lastError: " + last_error->error());
}
// See comment in SetError().
« no previous file with comments | « extensions/renderer/api_last_error.h ('k') | extensions/renderer/api_last_error_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698