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

Unified Diff: runtime/observatory/lib/src/service/object.dart

Issue 869773007: Port _echo, etc commands to RPC (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | « no previous file | runtime/observatory/test/echo_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/service/object.dart
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index 609c7bd61edc537985a0bb04c42c5ff2b7f8f211..b56048bb0509b0888ce26d7b231e5328f923b7ad 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -495,8 +495,13 @@ abstract class VM extends ServiceObjectOwner {
try {
var decoder = new JsonDecoder(_reviver);
map = decoder.convert(response);
- } catch (e, st) {
- return null;
+ } catch (e) {
+ return toObservable({
+ 'type': 'ServiceException',
+ 'kind': 'JSONDecodeException',
+ 'response': map,
+ 'message': 'Could not decode JSON: $e',
+ });
}
return toObservable(map);
}
@@ -507,8 +512,7 @@ abstract class VM extends ServiceObjectOwner {
return new Future.error(
new ServiceObject._fromMap(this, toObservable({
'type': 'ServiceException',
- 'id': '',
- 'kind': 'FormatException',
+ 'kind': 'ResponseFormatException',
'response': map,
'message': 'Top level service responses must be service maps: ${map}.',
})));
@@ -523,21 +527,6 @@ abstract class VM extends ServiceObjectOwner {
return new Future.value(map);
}
- Future<ObservableMap> _decodeError(e) {
- return new Future.error(new ServiceObject._fromMap(this, toObservable({
- 'type': 'ServiceException',
- 'id': '',
- 'kind': 'DecodeException',
- 'response':
- 'This is likely a result of a known V8 bug. Although the '
- 'the bug has been fixed the fix may not be in your Chrome'
- ' version. For more information see dartbug.com/18385. '
- 'Observatory is still functioning and you should try your'
- ' action again.',
- 'message': 'Could not decode JSON: $e',
- })));
- }
-
/// Gets [id] as an [ObservableMap] from the service directly. If
/// an error occurs, the future is completed as an error with a
/// ServiceError or ServiceException. Therefore any chained then() calls
« no previous file with comments | « no previous file | runtime/observatory/test/echo_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698