| 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.
|
|
|