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

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

Issue 815233002: Catch exceptions in refactorings and return them as a SERVER_ERROR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 /** 744 /**
745 * Initialize a newly created instance to represent an error condition caused 745 * Initialize a newly created instance to represent an error condition caused
746 * by a malformed request. 746 * by a malformed request.
747 */ 747 */
748 Response.invalidRequestFormat() 748 Response.invalidRequestFormat()
749 : this( 749 : this(
750 '', 750 '',
751 error: new RequestError(RequestErrorCode.INVALID_REQUEST, 'Invalid req uest')); 751 error: new RequestError(RequestErrorCode.INVALID_REQUEST, 'Invalid req uest'));
752 752
753 /** 753 /**
754 * Initialize a newly created instance to represent the SERVER_ERROR error
755 * condition.
756 */
757 factory Response.serverError(Request request, exception, stackTrace) {
758 RequestError error =
759 new RequestError(RequestErrorCode.SERVER_ERROR, exception.toString());
760 if (stackTrace != null) {
761 error.stackTrace = stackTrace.toString();
762 }
763 return new Response(request.id, error: error);
764 }
765
766 /**
754 * Initialize a newly created instance to represent the 767 * Initialize a newly created instance to represent the
755 * SORT_MEMBERS_INVALID_FILE error condition. 768 * SORT_MEMBERS_INVALID_FILE error condition.
756 */ 769 */
757 Response.sortMembersInvalidFile(Request request) 770 Response.sortMembersInvalidFile(Request request)
758 : this( 771 : this(
759 request.id, 772 request.id,
760 error: new RequestError( 773 error: new RequestError(
761 RequestErrorCode.SORT_MEMBERS_INVALID_FILE, 774 RequestErrorCode.SORT_MEMBERS_INVALID_FILE,
762 'Error during `edit.sortMembers`: invalid file.')); 775 'Error during `edit.sortMembers`: invalid file.'));
763 776
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); 865 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
853 hash = hash ^ (hash >> 11); 866 hash = hash ^ (hash >> 11);
854 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); 867 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
855 } 868 }
856 869
857 static int hash2(a, b) => finish(combine(combine(0, a), b)); 870 static int hash2(a, b) => finish(combine(combine(0, a), b));
858 871
859 static int hash4(a, b, c, d) => 872 static int hash4(a, b, c, d) =>
860 finish(combine(combine(combine(combine(0, a), b), c), d)); 873 finish(combine(combine(combine(combine(0, a), b), c), d));
861 } 874 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/edit/edit_domain.dart ('k') | pkg/analysis_server/test/edit/refactoring_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698