1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_
6 #define COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_
7 
8 namespace cronet {
9 
10 // Error codes for the most popular network stack error codes.
11 // For descriptions see corresponding constants in UrlRequestException.java.
12 // A Java counterpart will be generated for this enum.
13 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net.impl
14 enum UrlRequestError {
15   LISTENER_EXCEPTION_THROWN,
16   HOSTNAME_NOT_RESOLVED,
17   INTERNET_DISCONNECTED,
18   NETWORK_CHANGED,
19   TIMED_OUT,
20   CONNECTION_CLOSED,
21   CONNECTION_TIMED_OUT,
22   CONNECTION_REFUSED,
23   CONNECTION_RESET,
24   ADDRESS_UNREACHABLE,
25   QUIC_PROTOCOL_FAILED,
26   OTHER,
27 };
28 
29 // Converts most popular net::ERR_* values to counterparts accessible in Java.
30 UrlRequestError NetErrorToUrlRequestError(int net_error);
31 
32 }  // namespace cronet
33 
34 #endif  // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_
35