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

Side by Side Diff: runtime/vm/service/client.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of vmservice; 5 part of vmservice;
6 6
7 // A service client. 7 // A service client.
8 abstract class Client { 8 abstract class Client {
9 final VMService service; 9 final VMService service;
10 final bool sendEvents; 10 final bool sendEvents;
(...skipping 11 matching lines...) Expand all
22 22
23 /// Call to process a message. Response will be posted with 'seq'. 23 /// Call to process a message. Response will be posted with 'seq'.
24 void onMessage(var seq, Message message) { 24 void onMessage(var seq, Message message) {
25 try { 25 try {
26 // Send message to service. 26 // Send message to service.
27 service.route(message).then((response) { 27 service.route(message).then((response) {
28 // Call post when the response arrives. 28 // Call post when the response arrives.
29 post(response); 29 post(response);
30 }); 30 });
31 } catch (e, st) { 31 } catch (e, st) {
32 message.setErrorResponse('Internal error: $e'); 32 message.setErrorResponse(
33 kInternalError, 'Unexpected exception:$e\n$st');
33 post(message.response); 34 post(message.response);
34 } 35 }
35 } 36 }
36 37
37 // Sends a result to the client. Implemented in subclasses. 38 // Sends a result to the client. Implemented in subclasses.
38 void post(dynamic result); 39 void post(dynamic result);
39 40
40 dynamic toJson() { 41 dynamic toJson() {
41 return { 42 return {
42 }; 43 };
43 } 44 }
44 } 45 }
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/get_isolate_rpc_test.dart ('k') | runtime/vm/service/message.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698