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

Unified Diff: runtime/lib/isolate.cc

Issue 9186058: Make the "sticky error" an Error instead of a String. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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 | runtime/vm/allocation_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate.cc
===================================================================
--- runtime/lib/isolate.cc (revision 3366)
+++ runtime/lib/isolate.cc (working copy)
@@ -205,9 +205,9 @@
} else {
Zone zone(isolate);
HandleScope handle_scope(isolate);
- const String& error = String::Handle(
+ const Error& error = Error::Handle(
Isolate::Current()->object_store()->sticky_error());
- const char* errmsg = error.ToCString();
+ const char* errmsg = error.ToErrorCString();
OS::PrintErr("%s\n", errmsg);
exit(255);
}
@@ -229,16 +229,18 @@
name ^= String::NewSymbol(library_url);
const Library& lib = Library::Handle(Library::LookupLibrary(name));
if (lib.IsNull()) {
- const String& error = String::Handle(
+ const String& error_str = String::Handle(
String::New("Error starting Isolate, library not loaded : "));
+ const Error& error = Error::Handle(LanguageError::New(error_str));
Isolate::Current()->object_store()->set_sticky_error(error);
return false;
}
name ^= String::NewSymbol(class_name);
const Class& target_class = Class::Handle(lib.LookupClass(name));
if (target_class.IsNull()) {
- const String& error = String::Handle(
+ const String& error_str = String::Handle(
String::New("Error starting Isolate, class not loaded : "));
+ const Error& error = Error::Handle(LanguageError::New(error_str));
Isolate::Current()->object_store()->set_sticky_error(error);
return false;
}
@@ -285,9 +287,9 @@
{
Zone zone(spawned_isolate);
HandleScope scope(spawned_isolate);
- const String& errmsg = String::Handle(
+ const Error& err_obj = Error::Handle(
spawned_isolate->object_store()->sticky_error());
- error = strdup(errmsg.ToCString());
+ error = strdup(err_obj.ToErrorCString());
}
Dart::ShutdownIsolate();
spawned_isolate = NULL;
« no previous file with comments | « no previous file | runtime/vm/allocation_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698