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

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

Issue 993613002: Implement 'print', 'up', 'down', and 'frame' commands in the Observatory debugger. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 5 years, 9 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.cc ('k') | runtime/vm/service/message.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service/client.dart
diff --git a/runtime/vm/service/client.dart b/runtime/vm/service/client.dart
index a9cbd3885e1205918a8d0441c64356a6a0f793b9..1fd4f44ad8be0fac5f27427c3b77254cbe73586a 100644
--- a/runtime/vm/service/client.dart
+++ b/runtime/vm/service/client.dart
@@ -25,12 +25,16 @@ abstract class Client {
/// Call to process a message. Response will be posted with 'seq'.
void onMessage(var seq, Message message) {
- // Call post when the response arrives.
- message.response.then((response) {
- post(seq, response);
- });
- // Send message to service.
- service.route(message);
+ try {
+ // Send message to service.
+ service.route(message).then((response) {
+ // Call post when the response arrives.
+ post(seq, response);
+ });
+ } catch (e, st) {
+ message.setErrorResponse('Internal error: $e');
+ post(seq, message.response);
+ }
}
/// When implementing, responsible for sending [response] to the client.
« no previous file with comments | « runtime/vm/service.cc ('k') | runtime/vm/service/message.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698