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

Side by Side Diff: mojo/services/network/public/interfaces/network_error.mojom

Issue 933973002: Return errors from the Mojo network service using an enum. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module mojo; 5 module mojo;
6 6
7 struct NetworkError { 7 struct NetworkError {
8 int32 code; 8 NetworkCode code;
9 string? description; 9 string? description;
10 }; 10 };
11
12 // Corresponds to net/base/net_error_list.h.
jamesr 2015/02/18 18:43:06 this isn't a helpful comment in the mojom as consu
ppi 2015/02/19 14:22:18 Done.
13 enum NetworkCode {
14 OK = 0,
15
16 // An asynchronous IO operation is not yet complete. This usually does not
17 // indicate a fatal error. Typically this error will be generated as a
18 // notification to wait for some external notification that the IO operation
19 // finally completed.
20 IO_PENDING = -1,
21
22 // A generic failure occurred.
23 FAILED = -2,
24
25 // An operation was aborted (due to user action).
26 ABORTED = -3,
27
28 // An argument to the function is incorrect.
29 INVALID_ARGUMENT = -4,
30
31 // The handle or file descriptor is invalid.
32 INVALID_HANDLE = -5,
33
34 // The file or directory cannot be found.
35 FILE_NOT_FOUND = -6,
36
37 // An operation timed out.
38 TIMED_OUT = -7,
39
40 // The file is too large.
41 FILE_TOO_BIG = -8,
42
43 // An unexpected error. This may be caused by a programming mistake or an
44 // invalid assumption.
45 UNEXPECTED = -9,
46
47 // Permission to access a resource, other than the network, was denied.
48 ACCESS_DENIED = -10,
49
50 // The operation failed because of unimplemented functionality.
51 NOT_IMPLEMENTED = -11,
52
53 // There were not enough resources to complete the operation.
54 INSUFFICIENT_RESOURCES = -12,
55
56 // Memory allocation failed.
57 OUT_OF_MEMORY = -13,
58
59 // The file upload failed because the file's modification time was different
60 // from the expectation.
61 UPLOAD_FILE_CHANGED = -14,
62
63 // The socket is not connected.
64 SOCKET_NOT_CONNECTED = -15,
65
66 // The file already exists.
67 FILE_EXISTS = -16,
68
69 // The path or file name is too long.
70 FILE_PATH_TOO_LONG = -17,
71
72 // Not enough room left on the disk.
73 FILE_NO_SPACE = -18,
74
75 // The file has a virus.
76 FILE_VIRUS_INFECTED = -19,
77
78 // The client chose to block the request.
79 BLOCKED_BY_CLIENT = -20,
80
81 // The network changed.
82 NETWORK_CHANGED = -21,
83
84 // The request was blocked by the URL blacklist configured by the domain
85 // administrator.
86 BLOCKED_BY_ADMINISTRATOR = -22,
87
88 // The socket is already connected.
89 SOCKET_IS_CONNECTED = -23,
90
91 // The request was blocked because the forced reenrollment check is still
92 // pending. This error can only occur on ChromeOS. The error can be emitted by
93 // code in chrome/browser/policy/policy_helpers.cc.
94 BLOCKED_ENROLLMENT_CHECK_PENDING = -24,
95
96 // The upload failed because the upload stream needed to be re-read, due to a
97 // retry or a redirect, but the upload stream doesn't support that operation.
98 UPLOAD_STREAM_REWIND_NOT_SUPPORTED = -25,
99
100 // A connection was closed (corresponding to a TCP FIN).
101 CONNECTION_CLOSED = -100,
102
103 // A connection was reset (corresponding to a TCP RST).
104 CONNECTION_RESET = -101,
105
106 // A connection attempt was refused.
107 CONNECTION_REFUSED = -102,
108
109 // A connection timed out as a result of not receiving an ACK for data sent.
110 // This can include a FIN packet that did not get ACK'd.
111 CONNECTION_ABORTED = -103,
112
113 // A connection attempt failed.
114 CONNECTION_FAILED = -104,
115
116 // The host name could not be resolved.
117 NAME_NOT_RESOLVED = -105,
118
119 // The Internet connection has been lost.
120 INTERNET_DISCONNECTED = -106,
121
122 // An SSL protocol error occurred.
123 SSL_PROTOCOL_ERROR = -107,
124
125 // The IP address or port number is invalid (e.g., cannot connect to the IP
126 // address 0 or the port 0).
127 ADDRESS_INVALID = -108,
128
129 // The IP address is unreachable. This usually means that there is no route to
130 // the specified host or network.
131 ADDRESS_UNREACHABLE = -109,
132
133 // The server requested a client certificate for SSL client authentication.
134 SSL_CLIENT_AUTH_CERT_NEEDED = -110,
135
136 // A tunnel connection through the proxy could not be established.
137 TUNNEL_CONNECTION_FAILED = -111,
138
139 // No SSL protocol versions are enabled.
140 NO_SSL_VERSIONS_ENABLED = -112,
141
142 // The client and server don't support a common SSL protocol version or
143 // cipher suite.
144 SSL_VERSION_OR_CIPHER_MISMATCH = -113,
145
146 // The server requested a renegotiation (rehandshake).
147 SSL_RENEGOTIATION_REQUESTED = -114,
148
149 // The proxy requested authentication (for tunnel establishment) with an
150 // unsupported method.
151 PROXY_AUTH_UNSUPPORTED = -115,
152
153 // During SSL renegotiation (rehandshake), the server sent a certificate with
154 // an error.
155 //
156 // Note: this error is not in the -2xx range so that it won't be handled as a
157 // certificate error.
158 CERT_ERROR_IN_SSL_RENEGOTIATION = -116,
159
160 // The SSL handshake failed because of a bad or missing client certificate.
161 BAD_SSL_CLIENT_AUTH_CERT = -117,
162
163 // A connection attempt timed out.
164 CONNECTION_TIMED_OUT = -118,
165
166 // There are too many pending DNS resolves, so a request in the queue was
167 // aborted.
168 HOST_RESOLVER_QUEUE_TOO_LARGE = -119,
169
170 // Failed establishing a connection to the SOCKS proxy server for a target
171 // host.
172 SOCKS_CONNECTION_FAILED = -120,
173
174 // The SOCKS proxy server failed establishing connection to the target host
175 // because that host is unreachable.
176 SOCKS_CONNECTION_HOST_UNREACHABLE = -121,
177
178 // The request to negotiate an alternate protocol failed.
179 NPN_NEGOTIATION_FAILED = -122,
180
181 // The peer sent an SSL no_renegotiation alert message.
182 SSL_NO_RENEGOTIATION = -123,
183
184 // Winsock sometimes reports more data written than passed. This is probably
185 // due to a broken LSP.
186 WINSOCK_UNEXPECTED_WRITTEN_BYTES = -124,
187
188 // An SSL peer sent us a fatal decompression_failure alert. This typically
189 // occurs when a peer selects DEFLATE compression in the mistaken belief that
190 // it supports it.
191 SSL_DECOMPRESSION_FAILURE_ALERT = -125,
192
193 // An SSL peer sent us a fatal bad_record_mac alert. This has been observed
194 // from servers with buggy DEFLATE support.
195 SSL_BAD_RECORD_MAC_ALERT = -126,
196
197 // The proxy requested authentication (for tunnel establishment).
198 PROXY_AUTH_REQUESTED = -127,
199
200 // A known TLS strict server didn't offer the renegotiation extension.
201 SSL_UNSAFE_NEGOTIATION = -128,
202
203 // The SSL server attempted to use a weak ephemeral Diffie-Hellman key.
204 SSL_WEAK_SERVER_EPHEMERAL_DH_KEY = -129,
205
206 // Could not create a connection to the proxy server. An error occurred
207 // either in resolving its name, or in connecting a socket to it.
208 // Note that this does NOT include failures during the actual "CONNECT" method
209 // of an HTTP proxy.
210 PROXY_CONNECTION_FAILED = -130,
211
212 // A mandatory proxy configuration could not be used. Currently this means
213 // that a mandatory PAC script could not be fetched, parsed or executed.
214 MANDATORY_PROXY_CONFIGURATION_FAILED = -131,
215
216 // We've hit the max socket limit for the socket pool while preconnecting. We
217 // don't bother trying to preconnect more sockets.
218 PRECONNECT_MAX_SOCKET_LIMIT = -133,
219
220 // The permission to use the SSL client certificate's private key was denied.
221 SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED = -134,
222
223 // The SSL client certificate has no private key.
224 SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY = -135,
225
226 // The certificate presented by the HTTPS Proxy was invalid.
227 PROXY_CERTIFICATE_INVALID = -136,
228
229 // An error occurred when trying to do a name resolution (DNS).
230 NAME_RESOLUTION_FAILED = -137,
231
232 // Permission to access the network was denied. This is used to distinguish
233 // errors that were most likely caused by a firewall from other access denied
234 // errors. See also ERR_ACCESS_DENIED.
235 NETWORK_ACCESS_DENIED = -138,
236
237 // The request throttler module cancelled this request to avoid DDOS.
238 TEMPORARILY_THROTTLED = -139,
239
240 // A request to create an SSL tunnel connection through the HTTPS proxy
241 // received a non-200 (OK) and non-407 (Proxy Auth) response. The response
242 // body might include a description of why the request failed.
243 HTTPS_PROXY_TUNNEL_RESPONSE = -140,
244
245 // We were unable to sign the CertificateVerify data of an SSL client auth
246 // handshake with the client certificate's private key.
247 //
248 // Possible causes for this include the user implicitly or explicitly
249 // denying access to the private key, the private key may not be valid for
250 // signing, the key may be relying on a cached handle which is no longer
251 // valid, or the CSP won't allow arbitrary data to be signed.
252 SSL_CLIENT_AUTH_SIGNATURE_FAILED = -141,
253
254 // The message was too large for the transport. (for example a UDP message
255 // which exceeds size threshold).
256 MSG_TOO_BIG = -142,
257
258 // A SPDY session already exists, and should be used instead of this
259 // connection.
260 SPDY_SESSION_ALREADY_EXISTS = -143,
261
262 // Websocket protocol error. Indicates that we are terminating the connection
263 // due to a malformed frame or other protocol violation.
264 WS_PROTOCOL_ERROR = -145,
265
266 // Connection was aborted for switching to another ptotocol.
267 // WebSocket abort SocketStream connection when alternate protocol is found.
268 PROTOCOL_SWITCHED = -146,
269
270 // Returned when attempting to bind an address that is already in use.
271 ADDRESS_IN_USE = -147,
272
273 // An operation failed because the SSL handshake has not completed.
274 SSL_HANDSHAKE_NOT_COMPLETED = -148,
275
276 // SSL peer's public key is invalid.
277 SSL_BAD_PEER_PUBLIC_KEY = -149,
278
279 // The certificate didn't match the built-in public key pins for the host
280 // name. The pins are set in net/http/transport_security_state.cc and require
281 // that one of a set of public keys exist on the path from the leaf to the
282 // root.
283 SSL_PINNED_KEY_NOT_IN_CERT_CHAIN = -150,
284
285 // Server request for client certificate did not contain any types we support.
286 CLIENT_AUTH_CERT_TYPE_UNSUPPORTED = -151,
287
288 // Server requested one type of cert, then requested a different type while
289 // the first was still being generated.
290 ORIGIN_BOUND_CERT_GENERATION_TYPE_MISMATCH = -152,
291
292 // An SSL peer sent us a fatal decrypt_error alert. This typically occurs when
293 // a peer could not correctly verify a signature (in CertificateVerify or
294 // ServerKeyExchange) or validate a Finished message.
295 SSL_DECRYPT_ERROR_ALERT = -153,
296
297 // There are too many pending WebSocketJob instances, so the new job was not
298 // pushed to the queue.
299 WS_THROTTLE_QUEUE_TOO_LARGE = -154,
300
301 // There are too many active SocketStream instances, so the new connect
302 // request was rejected.
303 TOO_MANY_SOCKET_STREAMS = -155,
304
305 // The SSL server certificate changed in a renegotiation.
306 SSL_SERVER_CERT_CHANGED = -156,
307
308 // The SSL server indicated that an unnecessary TLS version fallback was
309 // performed.
310 SSL_INAPPROPRIATE_FALLBACK = -157,
311
312 // Certificate Transparency: All Signed Certificate Timestamps failed to
313 // verify.
314 CT_NO_SCTS_VERIFIED_OK = -158,
315
316 // The SSL server sent us a fatal unrecognized_name alert.
317 SSL_UNRECOGNIZED_NAME_ALERT = -159,
318
319 // Failed to set the socket's receive buffer size as requested.
320 SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR = -160,
321
322 // Failed to set the socket's send buffer size as requested.
323 SOCKET_SET_SEND_BUFFER_SIZE_ERROR = -161,
324
325 // Failed to set the socket's receive buffer size as requested, despite
326 // success return code from setsockopt.
327 SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE = -162,
328
329 // Failed to set the socket's send buffer size as requested, despite success
330 // return code from setsockopt.
331 SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE = -163,
332
333 // Failed to import a client certificate from the platform store into the SSL
334 // library.
335 SSL_CLIENT_AUTH_CERT_BAD_FORMAT = -164,
336
337 // The SSL server requires falling back to a version older than the configured
338 // minimum fallback version, and thus fallback failed.
339 SSL_FALLBACK_BEYOND_MINIMUM_VERSION = -165
340 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698