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

Unified 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 side-by-side diff with in-line comments
Download patch
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 2a6e978d21d5b31fa5989f7a9cdeafd69bf54964..8dc44de2ad3b24e8300661cd6f9d82225702078b 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -751,6 +751,19 @@ class Response {
error: new RequestError(RequestErrorCode.INVALID_REQUEST, 'Invalid request'));
/**
+ * Initialize a newly created instance to represent the SERVER_ERROR error
+ * condition.
+ */
+ factory Response.serverError(Request request, exception, stackTrace) {
+ RequestError error =
+ new RequestError(RequestErrorCode.SERVER_ERROR, exception.toString());
+ if (stackTrace != null) {
+ error.stackTrace = stackTrace.toString();
+ }
+ return new Response(request.id, error: error);
+ }
+
+ /**
* Initialize a newly created instance to represent the
* SORT_MEMBERS_INVALID_FILE error condition.
*/
« 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