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

Side by Side Diff: pkg/analysis_server/lib/src/protocol.dart

Issue 1141773002: Fix server error messages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library protocol; 5 library protocol;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:convert'; 8 import 'dart:convert';
9 9
10 part 'generated_protocol.dart'; 10 part 'generated_protocol.dart';
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 587
588 RequestDecoder(this._request); 588 RequestDecoder(this._request);
589 589
590 RefactoringKind get refactoringKind { 590 RefactoringKind get refactoringKind {
591 // Refactoring feedback objects should never appear in requests. 591 // Refactoring feedback objects should never appear in requests.
592 return null; 592 return null;
593 } 593 }
594 594
595 @override 595 @override
596 dynamic mismatch(String jsonPath, String expected) { 596 dynamic mismatch(String jsonPath, String expected) {
597 return new RequestFailure( 597 return new RequestFailure(new Response.invalidParameter(
598 new Response.invalidParameter(_request, jsonPath, 'be $expected')); 598 _request, jsonPath, 'Expected to be $expected'));
599 } 599 }
600 600
601 @override 601 @override
602 dynamic missingKey(String jsonPath, String key) { 602 dynamic missingKey(String jsonPath, String key) {
603 return new RequestFailure(new Response.invalidParameter( 603 return new RequestFailure(new Response.invalidParameter(
604 _request, jsonPath, 'contain key ${JSON.encode(key)}')); 604 _request, jsonPath, 'Expected to contain key ${JSON.encode(key)}'));
605 } 605 }
606 } 606 }
607 607
608 /** 608 /**
609 * Instances of the class [RequestFailure] represent an exception that occurred 609 * Instances of the class [RequestFailure] represent an exception that occurred
610 * during the handling of a request that requires that an error be returned to 610 * during the handling of a request that requires that an error be returned to
611 * the client. 611 * the client.
612 */ 612 */
613 class RequestFailure implements Exception { 613 class RequestFailure implements Exception {
614 /** 614 /**
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); 911 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
912 hash = hash ^ (hash >> 11); 912 hash = hash ^ (hash >> 11);
913 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); 913 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
914 } 914 }
915 915
916 static int hash2(a, b) => finish(combine(combine(0, a), b)); 916 static int hash2(a, b) => finish(combine(combine(0, a), b));
917 917
918 static int hash4(a, b, c, d) => 918 static int hash4(a, b, c, d) =>
919 finish(combine(combine(combine(combine(0, a), b), c), d)); 919 finish(combine(combine(combine(combine(0, a), b), c), d));
920 } 920 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698