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

Unified Diff: pkg/analyzer_plugin/lib/protocol/protocol.dart

Issue 2887453004: Minor cleanup of error reporting in plugins (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer_plugin/lib/protocol/protocol.dart
diff --git a/pkg/analyzer_plugin/lib/protocol/protocol.dart b/pkg/analyzer_plugin/lib/protocol/protocol.dart
index 392bd4c45e82ef1358264e36f2bc5aee6c95741c..4799f654b889c354f0f960c7724e2f7a1fe86304 100644
--- a/pkg/analyzer_plugin/lib/protocol/protocol.dart
+++ b/pkg/analyzer_plugin/lib/protocol/protocol.dart
@@ -289,30 +289,29 @@ class RequestErrorFactory {
'Invalid overlay change: no content to change');
/**
- * Return a request error representing an error condition caused by a
- * [request] that had an invalid parameter. The [path] is the path to the
- * invalid parameter, in Javascript notation (e.g. "foo.bar" means that the
- * parameter "foo" contained a key "bar" whose value was the wrong type). The
+ * Return a request error representing an error condition caused by a request
+ * that had an invalid parameter. The [path] is the path to the invalid
+ * parameter, in Javascript notation (e.g. "foo.bar" means that the parameter
+ * "foo" contained a key "bar" whose value was the wrong type). The
* [expectation] is a description of the type of data that was expected.
*/
- static RequestError invalidParameter(
- Request request, String path, String expectation) =>
+ static RequestError invalidParameter(String path, String expectation) =>
new RequestError(RequestErrorCode.INVALID_PARAMETER,
"Invalid parameter '$path'. $expectation.");
/**
* Return a request error representing an error that occurred in the plugin.
*/
- static RequestError pluginError(Request request, exception, stackTrace) =>
+ static RequestError pluginError(exception, String stackTrace) =>
new RequestError(RequestErrorCode.PLUGIN_ERROR, exception.toString(),
stackTrace: stackTrace);
/**
- * Return a request error representing an error condition caused by a
- * [request] that cannot be handled by any known handlers.
+ * Return a request error representing an error condition caused by a request
+ * with the given [method] that cannot be handled by any known handlers.
*/
- static RequestError unknownRequest(Request request) =>
- new RequestError(RequestErrorCode.UNKNOWN_REQUEST, 'Unknown request');
+ static RequestError unknownRequest(String method) => new RequestError(
+ RequestErrorCode.UNKNOWN_REQUEST, 'Unknown request: $method');
}
/**
« no previous file with comments | « pkg/analyzer_plugin/lib/plugin/plugin.dart ('k') | pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698