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

Unified Diff: chrome/renderer/module_system.cc

Issue 10900013: Merge 153283 - Make ModuleSystem::DumpException() handle empty handles. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1229/src/
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/module_system.cc
===================================================================
--- chrome/renderer/module_system.cc (revision 153758)
+++ chrome/renderer/module_system.cc (working copy)
@@ -67,12 +67,23 @@
return;
}
- LOG(ERROR) << "["
- << *v8::String::Utf8Value(
- message->GetScriptResourceName()->ToString())
- << "(" << message->GetLineNumber() << ")] "
- << *v8::String::Utf8Value(message->Get())
- << "{" << *v8::String::Utf8Value(try_catch.StackTrace()) << "}";
+ std::string resource_name = "<unknown resource>";
+ if (!message->GetScriptResourceName().IsEmpty()) {
+ resource_name = *v8::String::Utf8Value(
+ message->GetScriptResourceName()->ToString());
+ }
+
+ std::string error_message = "<no error message>";
+ if (!message->Get().IsEmpty())
+ error_message = *v8::String::Utf8Value(message->Get());
+
+ std::string stack_trace = "<stack trace unavailable>";
+ if (!try_catch.StackTrace().IsEmpty())
+ stack_trace = *v8::String::Utf8Value(try_catch.StackTrace());
+
+ LOG(ERROR) << "[" << resource_name << "(" << message->GetLineNumber() << ")] "
+ << error_message
+ << "{" << stack_trace << "}";
}
void ModuleSystem::Require(const std::string& module_name) {
« 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