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

Side by Side Diff: runtime/bin/vmservice/server.dart

Issue 2287603004: Log exceptions in vmservice post() (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_io; 5 part of vmservice_io;
6 6
7 class WebSocketClient extends Client { 7 class WebSocketClient extends Client {
8 static const int PARSE_ERROR_CODE = 4000; 8 static const int PARSE_ERROR_CODE = 4000;
9 static const int BINARY_MESSAGE_ERROR_CODE = 4001; 9 static const int BINARY_MESSAGE_ERROR_CODE = 4001;
10 static const int NOT_MAP_ERROR_CODE = 4002; 10 static const int NOT_MAP_ERROR_CODE = 4002;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 try { 53 try {
54 if (result is String || result is Uint8List) { 54 if (result is String || result is Uint8List) {
55 socket.add(result); // String or binary message. 55 socket.add(result); // String or binary message.
56 } else { 56 } else {
57 // String message as external Uint8List. 57 // String message as external Uint8List.
58 assert(result is List); 58 assert(result is List);
59 Uint8List cstring = result[0]; 59 Uint8List cstring = result[0];
60 socket.addUtf8Text(cstring); 60 socket.addUtf8Text(cstring);
61 } 61 }
62 } catch (_) { 62 } catch (e, st) {
63 print("Ignoring error posting over WebSocket."); 63 print("Ignoring error posting over WebSocket.");
64 print(e);
65 print(st);
64 } 66 }
65 } 67 }
66 68
67 dynamic toJson() { 69 dynamic toJson() {
68 Map map = super.toJson(); 70 Map map = super.toJson();
69 map['type'] = 'WebSocketClient'; 71 map['type'] = 'WebSocketClient';
70 map['socket'] = '$socket'; 72 map['socket'] = '$socket';
71 return map; 73 return map;
72 } 74 }
73 } 75 }
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 _notifyServerState("", 0); 320 _notifyServerState("", 0);
319 onServerAddressChange(null); 321 onServerAddressChange(null);
320 return this; 322 return this;
321 }); 323 });
322 } 324 }
323 325
324 } 326 }
325 327
326 void _notifyServerState(String ip, int port) 328 void _notifyServerState(String ip, int port)
327 native "VMServiceIO_NotifyServerState"; 329 native "VMServiceIO_NotifyServerState";
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698