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

Unified Diff: pkg/json_rpc_2/lib/src/exception.dart

Issue 691053006: Add a Client class to json_rpc_2. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 1 month 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
« no previous file with comments | « pkg/json_rpc_2/lib/src/client.dart ('k') | pkg/json_rpc_2/lib/src/server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/json_rpc_2/lib/src/exception.dart
diff --git a/pkg/json_rpc_2/lib/src/exception.dart b/pkg/json_rpc_2/lib/src/exception.dart
index be9c2d3e2e5ed3c025185eded901fd8fbcfc6a11..2fb0713286ec8b083ad7452176134fc41d7568c7 100644
--- a/pkg/json_rpc_2/lib/src/exception.dart
+++ b/pkg/json_rpc_2/lib/src/exception.dart
@@ -64,4 +64,11 @@ class RpcException implements Exception {
'id': id
};
}
+
+ String toString() {
+ var prefix = "JSON-RPC error $code";
+ var errorName = error_code.name(code);
+ if (errorName != null) prefix += " ($errorName)";
+ return "$prefix: $message";
+ }
}
« no previous file with comments | « pkg/json_rpc_2/lib/src/client.dart ('k') | pkg/json_rpc_2/lib/src/server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698