Skip to content

Commit 56efae5

Browse files
devoncarewalexander-doroshko
authored andcommitted
add some more logging information to help diagnose the 'method not found' errors (flutter#4125)
1 parent 50bc96c commit 56efae5

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/io/flutter/inspector/EvalOnDartLibrary.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public <T extends Obj> CompletableFuture<T> getObjHelper(ObjRef instance, Inspec
183183
getIsolateId(), instance.getId(), new GetObjectConsumer() {
184184
@Override
185185
public void onError(RPCError error) {
186-
future.completeExceptionally(new RuntimeException(error.toString()));
186+
future.completeExceptionally(new RuntimeException("RPCError calling getObject: " + error.toString()));
187187
}
188188

189189
@Override
@@ -193,7 +193,7 @@ public void received(Obj response) {
193193

194194
@Override
195195
public void received(Sentinel response) {
196-
future.completeExceptionally(new RuntimeException(response.toString()));
196+
future.completeExceptionally(new RuntimeException("Sentinel calling getObject: " + response.toString()));
197197
}
198198
}
199199
);
@@ -254,13 +254,13 @@ public void received(Isolate response) {
254254
}
255255

256256
@Override
257-
public void received(Sentinel response) {
258-
libraryRef.completeExceptionally(new RuntimeException(response.toString()));
257+
public void onError(RPCError error) {
258+
libraryRef.completeExceptionally(new RuntimeException("RPCError calling getIsolate:" + error.toString()));
259259
}
260260

261261
@Override
262-
public void onError(RPCError error) {
263-
libraryRef.completeExceptionally(new RuntimeException(error.toString()));
262+
public void received(Sentinel response) {
263+
libraryRef.completeExceptionally(new RuntimeException("Sentinel calling getIsolate:" + response.toString()));
264264
}
265265
});
266266
}

src/io/flutter/inspector/InspectorService.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,6 @@ private CompletableFuture<JsonElement> invokeServiceExtensionHelper(String metho
379379
vmService.callServiceExtension(
380380
getInspectorLibrary().getIsolateId(), ServiceExtensions.inspectorPrefix + methodName, params,
381381
new ServiceExtensionConsumer() {
382-
383-
@Override
384-
public void onError(RPCError error) {
385-
ret.completeExceptionally(new RuntimeException(error.getMessage()));
386-
}
387-
388382
@Override
389383
public void received(JsonObject object) {
390384
if (object == null) {
@@ -394,6 +388,11 @@ public void received(JsonObject object) {
394388
ret.complete(object.get("result"));
395389
}
396390
}
391+
392+
@Override
393+
public void onError(RPCError error) {
394+
ret.completeExceptionally(new RuntimeException("RPCError calling " + methodName + ": " + error.getMessage()));
395+
}
397396
}
398397
);
399398
return ret;

0 commit comments

Comments
 (0)