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

Side by Side Diff: pkg/analysis_server/lib/src/generated_protocol.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This file has been automatically generated. Please do not edit it manually. 5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script 6 // To regenerate the file, use the script
7 // "pkg/analysis_server/tool/spec/generate_files". 7 // "pkg/analysis_server/tool/spec/generate_files".
8 8
9 part of protocol; 9 part of protocol;
10 /** 10 /**
(...skipping 8064 matching lines...) Expand 10 before | Expand all | Expand 10 after
8075 return _JenkinsSmiHash.finish(hash); 8075 return _JenkinsSmiHash.finish(hash);
8076 } 8076 }
8077 } 8077 }
8078 8078
8079 /** 8079 /**
8080 * RequestError 8080 * RequestError
8081 * 8081 *
8082 * { 8082 * {
8083 * "code": RequestErrorCode 8083 * "code": RequestErrorCode
8084 * "message": String 8084 * "message": String
8085 * "data": optional object 8085 * "stackTrace": optional String
8086 * } 8086 * }
8087 */ 8087 */
8088 class RequestError implements HasToJson { 8088 class RequestError implements HasToJson {
8089 /** 8089 /**
8090 * A code that uniquely identifies the error that occurred. 8090 * A code that uniquely identifies the error that occurred.
8091 */ 8091 */
8092 RequestErrorCode code; 8092 RequestErrorCode code;
8093 8093
8094 /** 8094 /**
8095 * A short description of the error. 8095 * A short description of the error.
8096 */ 8096 */
8097 String message; 8097 String message;
8098 8098
8099 /** 8099 /**
8100 * Additional data related to the error. This field is omitted if there is no 8100 * The stack trace associated with processing the request, used for debugging
8101 * additional data available. 8101 * the server.
8102 */ 8102 */
8103 Map data; 8103 String stackTrace;
8104 8104
8105 RequestError(this.code, this.message, {this.data}); 8105 RequestError(this.code, this.message, {this.stackTrace});
8106 8106
8107 factory RequestError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) { 8107 factory RequestError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
8108 if (json == null) { 8108 if (json == null) {
8109 json = {}; 8109 json = {};
8110 } 8110 }
8111 if (json is Map) { 8111 if (json is Map) {
8112 RequestErrorCode code; 8112 RequestErrorCode code;
8113 if (json.containsKey("code")) { 8113 if (json.containsKey("code")) {
8114 code = new RequestErrorCode.fromJson(jsonDecoder, jsonPath + ".code", js on["code"]); 8114 code = new RequestErrorCode.fromJson(jsonDecoder, jsonPath + ".code", js on["code"]);
8115 } else { 8115 } else {
8116 throw jsonDecoder.missingKey(jsonPath, "code"); 8116 throw jsonDecoder.missingKey(jsonPath, "code");
8117 } 8117 }
8118 String message; 8118 String message;
8119 if (json.containsKey("message")) { 8119 if (json.containsKey("message")) {
8120 message = jsonDecoder._decodeString(jsonPath + ".message", json["message "]); 8120 message = jsonDecoder._decodeString(jsonPath + ".message", json["message "]);
8121 } else { 8121 } else {
8122 throw jsonDecoder.missingKey(jsonPath, "message"); 8122 throw jsonDecoder.missingKey(jsonPath, "message");
8123 } 8123 }
8124 Map data; 8124 String stackTrace;
8125 if (json.containsKey("data")) { 8125 if (json.containsKey("stackTrace")) {
8126 data = json["data"]; 8126 stackTrace = jsonDecoder._decodeString(jsonPath + ".stackTrace", json["s tackTrace"]);
8127 } 8127 }
8128 return new RequestError(code, message, data: data); 8128 return new RequestError(code, message, stackTrace: stackTrace);
8129 } else { 8129 } else {
8130 throw jsonDecoder.mismatch(jsonPath, "RequestError"); 8130 throw jsonDecoder.mismatch(jsonPath, "RequestError");
8131 } 8131 }
8132 } 8132 }
8133 8133
8134 Map<String, dynamic> toJson() { 8134 Map<String, dynamic> toJson() {
8135 Map<String, dynamic> result = {}; 8135 Map<String, dynamic> result = {};
8136 result["code"] = code.toJson(); 8136 result["code"] = code.toJson();
8137 result["message"] = message; 8137 result["message"] = message;
8138 if (data != null) { 8138 if (stackTrace != null) {
8139 result["data"] = data; 8139 result["stackTrace"] = stackTrace;
8140 } 8140 }
8141 return result; 8141 return result;
8142 } 8142 }
8143 8143
8144 @override 8144 @override
8145 String toString() => JSON.encode(toJson()); 8145 String toString() => JSON.encode(toJson());
8146 8146
8147 @override 8147 @override
8148 bool operator==(other) { 8148 bool operator==(other) {
8149 if (other is RequestError) { 8149 if (other is RequestError) {
8150 return code == other.code && 8150 return code == other.code &&
8151 message == other.message && 8151 message == other.message &&
8152 data == other.data; 8152 stackTrace == other.stackTrace;
8153 } 8153 }
8154 return false; 8154 return false;
8155 } 8155 }
8156 8156
8157 @override 8157 @override
8158 int get hashCode { 8158 int get hashCode {
8159 int hash = 0; 8159 int hash = 0;
8160 hash = _JenkinsSmiHash.combine(hash, code.hashCode); 8160 hash = _JenkinsSmiHash.combine(hash, code.hashCode);
8161 hash = _JenkinsSmiHash.combine(hash, message.hashCode); 8161 hash = _JenkinsSmiHash.combine(hash, message.hashCode);
8162 hash = _JenkinsSmiHash.combine(hash, data.hashCode); 8162 hash = _JenkinsSmiHash.combine(hash, stackTrace.hashCode);
8163 return _JenkinsSmiHash.finish(hash); 8163 return _JenkinsSmiHash.finish(hash);
8164 } 8164 }
8165 } 8165 }
8166 8166
8167 /** 8167 /**
8168 * RequestErrorCode 8168 * RequestErrorCode
8169 * 8169 *
8170 * enum { 8170 * enum {
8171 * GET_ERRORS_INVALID_FILE 8171 * GET_ERRORS_INVALID_FILE
8172 * INVALID_OVERLAY_CHANGE 8172 * INVALID_OVERLAY_CHANGE
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after
10015 return false; 10015 return false;
10016 } 10016 }
10017 10017
10018 @override 10018 @override
10019 int get hashCode { 10019 int get hashCode {
10020 int hash = 0; 10020 int hash = 0;
10021 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); 10021 hash = _JenkinsSmiHash.combine(hash, newName.hashCode);
10022 return _JenkinsSmiHash.finish(hash); 10022 return _JenkinsSmiHash.finish(hash);
10023 } 10023 }
10024 } 10024 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/constants.dart ('k') | pkg/analysis_server/test/integration/protocol_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698