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

Side by Side Diff: lib/error_code.dart

Issue 1577363003: Get rid of all the library tags. (Closed) Base URL: git@github.com:dart-lang/json_rpc_2.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | lib/json_rpc_2.dart » ('j') | 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 /// Error codes defined in the [JSON-RPC 2.0 specificiation][spec]. 5 /// Error codes defined in the [JSON-RPC 2.0 specificiation][spec].
6 /// 6 ///
7 /// These codes are generally used for protocol-level communication. Most of 7 /// These codes are generally used for protocol-level communication. Most of
8 /// them shouldn't be used by the application. Those that should have 8 /// them shouldn't be used by the application. Those that should have
9 /// convenience constructors in [RpcException]. 9 /// convenience constructors in [RpcException].
10 /// 10 ///
11 /// [spec]: http://www.jsonrpc.org/specification#error_object 11 /// [spec]: http://www.jsonrpc.org/specification#error_object
12 library json_rpc_2.error_code;
13
14 /// An error code indicating that invalid JSON was received by the server. 12 /// An error code indicating that invalid JSON was received by the server.
15 const PARSE_ERROR = -32700; 13 const PARSE_ERROR = -32700;
16 14
17 /// An error code indicating that the request JSON was invalid according to the 15 /// An error code indicating that the request JSON was invalid according to the
18 /// JSON-RPC 2.0 spec. 16 /// JSON-RPC 2.0 spec.
19 const INVALID_REQUEST = -32600; 17 const INVALID_REQUEST = -32600;
20 18
21 /// An error code indicating that the requested method does not exist or is 19 /// An error code indicating that the requested method does not exist or is
22 /// unavailable. 20 /// unavailable.
23 const METHOD_NOT_FOUND = -32601; 21 const METHOD_NOT_FOUND = -32601;
(...skipping 18 matching lines...) Expand all
42 String name(int errorCode) { 40 String name(int errorCode) {
43 switch (errorCode) { 41 switch (errorCode) {
44 case PARSE_ERROR: return "parse error"; 42 case PARSE_ERROR: return "parse error";
45 case INVALID_REQUEST: return "invalid request"; 43 case INVALID_REQUEST: return "invalid request";
46 case METHOD_NOT_FOUND: return "method not found"; 44 case METHOD_NOT_FOUND: return "method not found";
47 case INVALID_PARAMS: return "invalid parameters"; 45 case INVALID_PARAMS: return "invalid parameters";
48 case INTERNAL_ERROR: return "internal error"; 46 case INTERNAL_ERROR: return "internal error";
49 default: return null; 47 default: return null;
50 } 48 }
51 } 49 }
OLDNEW
« no previous file with comments | « no previous file | lib/json_rpc_2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698