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

Unified Diff: runtime/vm/service/running_isolates.dart

Issue 1297313005: Fix the error response for bad isolate ids, etc. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « runtime/vm/service/message.dart ('k') | runtime/vm/service/vmservice.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service/running_isolates.dart
diff --git a/runtime/vm/service/running_isolates.dart b/runtime/vm/service/running_isolates.dart
index 12ca0b76f91b5ce52c6e6d2786cf4e5c0bac73d7..48ac1f52dda621a6769f1718bc2dca80c4a9a645 100644
--- a/runtime/vm/service/running_isolates.dart
+++ b/runtime/vm/service/running_isolates.dart
@@ -29,7 +29,8 @@ class RunningIsolates implements MessageRouter {
String isolateParam = message.params['isolateId'];
int isolateId;
if (!isolateParam.startsWith('isolates/')) {
- message.setErrorResponse('Malformed isolate id $isolateParam');
+ message.setErrorResponse(
+ kInvalidParams, "invalid 'isolateId' parameter: $isolateParam");
return message.response;
}
isolateParam = isolateParam.substring('isolates/'.length);
@@ -39,13 +40,15 @@ class RunningIsolates implements MessageRouter {
try {
isolateId = int.parse(isolateParam);
} catch (e) {
- message.setErrorResponse('Could not parse isolate id: $e');
+ message.setErrorResponse(
+ kInvalidParams, "invalid 'isolateId' parameter: $isolateParam");
return message.response;
}
}
var isolate = isolates[isolateId];
if (isolate == null) {
- message.setErrorResponse('Cannot find isolate id: $isolateId');
+ message.setErrorResponse(
+ kInvalidParams, "invalid 'isolateId' parameter: $isolateParam");
return message.response;
}
return isolate.route(message);
« no previous file with comments | « runtime/vm/service/message.dart ('k') | runtime/vm/service/vmservice.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698