Skip to content

Commit

Permalink
[API] Makes Dart_InvokeVMServiceMethod errors more specific.
Browse files Browse the repository at this point in the history
Specifies that the 'isolate' mentioned in the error message is always the
service isolate.
Also adds a specific error message for when the service isolate port isn't
found, which can indicate the service isn't there (yet?).

Change-Id: I1f29b7c4ccf4df2c3dbefafe05f410e4725488e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111426
Reviewed-by: Martin Kustermann <[email protected]>
Commit-Queue: Clement Skau <[email protected]>
  • Loading branch information
Clement Skau authored and [email protected] committed Jul 31, 2019
1 parent 2e197ae commit 8cce940
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtime/vm/native_api_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ DART_EXPORT bool Dart_InvokeVMServiceMethod(uint8_t* request_json,
Dart_CloseNativePort(port);

if (error != nullptr) {
*error = strdup("Was unable to post message to isolate.");
if (ServiceIsolate::Port() == ILLEGAL_PORT) {
*error = strdup("No service isolate port was found.");
} else {
*error = strdup("Was unable to post message to service isolate.");
}
}
return false;
}
Expand Down

0 comments on commit 8cce940

Please sign in to comment.