@@ -238,19 +238,13 @@ class StreamManager {
238
238
if (streamListeners[stream]! .contains (client)) {
239
239
throw kStreamAlreadySubscribedException;
240
240
} else if (! streamNewlySubscribed && includePrivates != null ) {
241
- try {
242
- await dds.vmServiceClient.sendRequest (
243
- '_setStreamIncludePrivateMembers' ,
244
- {'streamId' : stream, 'includePrivateMembers' : includePrivates});
245
- } on json_rpc.RpcException catch (e) {
246
- // This private RPC might not be present. If it's not, we're communicating with an older
247
- // VM that doesn't support filtering private members, so they will always be included in
248
- // responses. Handle the method not found exception so the streamListen call doesn't
249
- // fail for older VMs.
250
- if (e.code != RpcErrorCodes .kMethodNotFound) {
251
- rethrow ;
252
- }
253
- }
241
+ // This private RPC might not be present. If it's not, we're communicating with an older
242
+ // VM that doesn't support filtering private members, so they will always be included in
243
+ // responses. Handle the method not found exception so the streamListen call doesn't
244
+ // fail for older VMs.
245
+ await dds.vmServiceClient.sendRequestAndIgnoreMethodNotFound (
246
+ '_setStreamIncludePrivateMembers' ,
247
+ {'streamId' : stream, 'includePrivateMembers' : includePrivates});
254
248
}
255
249
if (client != null ) {
256
250
streamListeners[stream]! .add (client);
@@ -352,9 +346,12 @@ class StreamManager {
352
346
_profilerUserTagSubscriptions.remove (subscribedTag);
353
347
}
354
348
}
355
- await dds.vmServiceClient.sendRequest ('streamCpuSamplesWithUserTag' , {
356
- 'userTags' : _profilerUserTagSubscriptions.toList (),
357
- });
349
+ await dds.vmServiceClient.sendRequestAndIgnoreMethodNotFound (
350
+ 'streamCpuSamplesWithUserTag' ,
351
+ {
352
+ 'userTags' : _profilerUserTagSubscriptions.toList (),
353
+ },
354
+ );
358
355
});
359
356
}
360
357
0 commit comments