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

Unified Diff: chrome/renderer/module_system.cc

Issue 10894029: Manual merge r153283 to b1180: Make ModuleSystem::DumpException() handle empty handles. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/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 153794)
+++ chrome/renderer/module_system.cc (working copy)
@@ -59,11 +59,18 @@
// static
void ModuleSystem::DumpException(v8::Handle<v8::Message> message) {
- LOG(ERROR) << "["
- << *v8::String::Utf8Value(
- message->GetScriptResourceName()->ToString())
- << "(" << message->GetLineNumber() << ")] "
- << *v8::String::Utf8Value(message->Get());
+ 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());
+
+ LOG(ERROR) << "[" << resource_name << "(" << message->GetLineNumber() << ")] "
+ << error_message;
}
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