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

Unified Diff: pkg/analysis_server/lib/src/protocol.dart

Issue 282993002: Leave "error" key out of response JSON when there is no error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | pkg/analysis_server/test/domain_context_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/protocol.dart
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
index ef58a8aba429af2143d5968a7468d5e64d8e5b7c..7cdfa18de0c22eb00ea302288a470cda0cc29a96 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -412,9 +412,7 @@ class Response {
Map<String, Object> toJson() {
Map<String, Object> jsonObject = new Map<String, Object>();
jsonObject[ID] = id;
- if (error == null) {
- jsonObject[ERROR] = null;
- } else {
+ if (error != null) {
jsonObject[ERROR] = error.toJson();
}
if (!result.isEmpty) {
@@ -451,7 +449,7 @@ class RequestError {
* server. An error occurred on the server while parsing the JSON text.
*/
static const int CODE_PARSE_ERROR = -32700;
-
+
/**
* An error code indicating that the analysis server has already been
* started (and hence won't accept new connections).
@@ -523,7 +521,7 @@ class RequestError {
*/
RequestError.serverAlreadyStarted()
: this(CODE_SERVER_ALREADY_STARTED, "Server already started");
-
+
/**
* Initialize a newly created [Error] to indicate an invalid request. The
* JSON sent is not a valid [Request] object.
« no previous file with comments | « no previous file | pkg/analysis_server/test/domain_context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698