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

Unified Diff: pkg/analysis_server/test/protocol_test.dart

Issue 569743003: update error handling to send response with stack trace (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/protocol_test.dart
diff --git a/pkg/analysis_server/test/protocol_test.dart b/pkg/analysis_server/test/protocol_test.dart
index aed748364c24ff09796b8308058eac7920b34b38..b12e1319f881756f84d46c4fa8c229fd2efe73f4 100644
--- a/pkg/analysis_server/test/protocol_test.dart
+++ b/pkg/analysis_server/test/protocol_test.dart
@@ -105,32 +105,27 @@ class RequestErrorTest {
}
void test_fromJson() {
+ var trace = 'a stack trace\r\nfoo';
var json = {
CODE: RequestErrorCode.INVALID_PARAMETER.name,
MESSAGE: 'foo',
- DATA: {
- 'ints': [1, 2, 3]
- }
+ STACK_TRACE: trace
};
RequestError error = new RequestError.fromJson(new ResponseDecoder(null), '',
json);
expect(error.code, RequestErrorCode.INVALID_PARAMETER);
expect(error.message, "foo");
- expect(error.data['ints'], [1, 2, 3]);
+ expect(error.stackTrace, trace);
}
void test_toJson() {
+ var trace = 'a stack trace\r\nbar';
RequestError error = new RequestError(
- RequestErrorCode.UNKNOWN_REQUEST, 'msg', data: {});
- error.data['answer'] = 42;
- error.data['question'] = 'unknown';
+ RequestErrorCode.UNKNOWN_REQUEST, 'msg', stackTrace: trace);
expect(error.toJson(), {
CODE: 'UNKNOWN_REQUEST',
MESSAGE: 'msg',
- DATA: {
- 'answer': 42,
- 'question': 'unknown'
- }
+ STACK_TRACE: trace
});
}
}
« no previous file with comments | « pkg/analysis_server/test/integration/protocol_matchers.dart ('k') | pkg/analysis_server/test/socket_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698