OLD | NEW |
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 /** | 5 /** |
6 * Support for client code that needs to interact with the requests, responses | 6 * Support for client code that needs to interact with the requests, responses |
7 * and notifications that are part of the analysis server's wire protocol. | 7 * and notifications that are part of the analysis server's wire protocol. |
8 */ | 8 */ |
9 library analysis_server.plugin.protocol.protocol; | 9 library analysis_server.plugin.protocol.protocol; |
10 | 10 |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 */ | 536 */ |
537 Response.unanalyzedPriorityFiles(String requestId, String fileNames) | 537 Response.unanalyzedPriorityFiles(String requestId, String fileNames) |
538 : this(requestId, | 538 : this(requestId, |
539 error: new RequestError(RequestErrorCode.UNANALYZED_PRIORITY_FILES, | 539 error: new RequestError(RequestErrorCode.UNANALYZED_PRIORITY_FILES, |
540 "Unanalyzed files cannot be a priority: '$fileNames'")); | 540 "Unanalyzed files cannot be a priority: '$fileNames'")); |
541 | 541 |
542 /** | 542 /** |
543 * Initialize a newly created instance to represent an error condition caused | 543 * Initialize a newly created instance to represent an error condition caused |
544 * by a [request] that cannot be handled by any known handlers. | 544 * by a [request] that cannot be handled by any known handlers. |
545 */ | 545 */ |
| 546 Response.errorHandlingRequest(Request request, dynamic error) |
| 547 : this(request.id, |
| 548 error: new RequestError( |
| 549 RequestErrorCode.ERROR_HANDLING_REQUEST, '$error')); |
| 550 |
| 551 /** |
| 552 * Initialize a newly created instance to represent an error condition caused |
| 553 * by a [request] that cannot be handled by any known handlers. |
| 554 */ |
546 Response.unknownRequest(Request request) | 555 Response.unknownRequest(Request request) |
547 : this(request.id, | 556 : this(request.id, |
548 error: new RequestError( | 557 error: new RequestError( |
549 RequestErrorCode.UNKNOWN_REQUEST, 'Unknown request')); | 558 RequestErrorCode.UNKNOWN_REQUEST, 'Unknown request')); |
550 | 559 |
551 /** | 560 /** |
552 * Initialize a newly created instance to represent an error condition caused | 561 * Initialize a newly created instance to represent an error condition caused |
553 * by a [request] referencing a source that does not exist. | 562 * by a [request] referencing a source that does not exist. |
554 */ | 563 */ |
555 Response.unknownSource(Request request) | 564 Response.unknownSource(Request request) |
(...skipping 25 matching lines...) Expand all Loading... |
581 jsonObject[ID] = id; | 590 jsonObject[ID] = id; |
582 if (error != null) { | 591 if (error != null) { |
583 jsonObject[ERROR] = error.toJson(); | 592 jsonObject[ERROR] = error.toJson(); |
584 } | 593 } |
585 if (_result != null) { | 594 if (_result != null) { |
586 jsonObject[RESULT] = _result; | 595 jsonObject[RESULT] = _result; |
587 } | 596 } |
588 return jsonObject; | 597 return jsonObject; |
589 } | 598 } |
590 } | 599 } |
OLD | NEW |