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

Unified Diff: runtime/vm/isolate.cc

Issue 11413101: Added support for isolate unhandled exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated code review feedback Created 8 years, 1 month 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 | « runtime/vm/isolate.h ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 6b9178d0b55bd32e7099967d285d0823738ccd6c..e24788127f836c0e5b54734a31fb736c453ce582 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -110,8 +110,16 @@ bool IsolateMessageHandler::HandleMessage(Message* message) {
DartLibraryCalls::HandleMessage(
message->dest_port(), message->reply_port(), msg));
delete message;
- if (result.IsError()) {
- isolate_->object_store()->set_sticky_error(Error::Cast(result));
+ if (result.IsError() || result.IsUnhandledException()) {
+ if (result.IsError()) {
+ isolate_->object_store()->set_sticky_error(Error::Cast(result));
+ }
+ if (Isolate::UnhandledExceptionCallback() != NULL) {
+ Dart_EnterScope();
+ Dart_Handle error = Api::NewHandle(isolate_, result.raw());
+ (Isolate::UnhandledExceptionCallback())(error);
+ Dart_ExitScope();
+ }
return false;
}
ASSERT(result.IsNull());
@@ -446,6 +454,8 @@ void Isolate::Shutdown() {
Dart_IsolateCreateCallback Isolate::create_callback_ = NULL;
Dart_IsolateInterruptCallback Isolate::interrupt_callback_ = NULL;
+Dart_IsolateUnhandledExceptionCallback
+ Isolate::unhandled_exception_callback_ = NULL;
Dart_IsolateShutdownCallback Isolate::shutdown_callback_ = NULL;
« no previous file with comments | « runtime/vm/isolate.h ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698