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

Side by Side Diff: components/cronet/android/api/src/org/chromium/net/UrlRequestException.java

Issue 2069303002: Add new Cronet exception class for QUIC errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add UrlRequestException top-level error for QUIC, and other comments Created 4 years, 5 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 package org.chromium.net; 5 package org.chromium.net;
6 6
7 import java.io.IOException; 7 import java.io.IOException;
8 8
9 /** 9 /**
10 * Exception passed to {@link UrlRequest.Callback#onFailed UrlRequest.Callback.o nFailed()} when: 10 * Exception passed to {@link UrlRequest.Callback#onFailed UrlRequest.Callback.o nFailed()} when:
11 * <ul> 11 * <ul>
12 * <li>{@link UrlRequest.Callback} or {@link UploadDataProvider} method throws a n exception. In this 12 * <li>{@link UrlRequest.Callback} or {@link UploadDataProvider} method throws a n exception. In this
13 * case {@link IOException#getCause getCause()} can be used to find the thro wn exception. 13 * case {@link IOException#getCause getCause()} can be used to find the thro wn exception.
14 * {@link #getErrorCode} will return {@link #ERROR_LISTENER_EXCEPTION_THROWN }. 14 * {@link #getErrorCode} will return {@link #ERROR_LISTENER_EXCEPTION_THROWN }.
15 * <li>Cronet fails to process a network request. In this case 15 * <li>Cronet fails to process a network request. In this case
16 * {@link #getErrorCode} and {@link #getCronetInternalErrorCode} can be used to get more 16 * {@link #getErrorCode} and {@link #getCronetInternalErrorCode} can be used to get more
17 * information about the specific type of failure. 17 * information about the specific type of failure. If {@link #getErrorCode}
18 * returns {@link #ERROR_QUIC_PROTOCOL_FAILED}, this exception can be cast t o a
19 * {@link QuicException}
pauljensen 2016/07/01 12:22:02 funky line wrapping
mgersh 2016/07/01 15:21:15 Done.
20 * which can provide further details.
18 * </ul> 21 * </ul>
19 */ 22 */
20 public class UrlRequestException extends IOException { 23 public class UrlRequestException extends IOException {
21 /** 24 /**
22 * Error code indicating this class wraps an exception thrown by {@link UrlR equest.Callback} or 25 * Error code indicating this class wraps an exception thrown by {@link UrlR equest.Callback} or
23 * {@link UploadDataProvider}. Wrapped exception can be retrieved using 26 * {@link UploadDataProvider}. Wrapped exception can be retrieved using
24 * {@link IOException#getCause}. 27 * {@link IOException#getCause}.
25 */ 28 */
26 public static final int ERROR_LISTENER_EXCEPTION_THROWN = 29 public static final int ERROR_LISTENER_EXCEPTION_THROWN =
27 UrlRequestError.LISTENER_EXCEPTION_THROWN; 30 UrlRequestError.LISTENER_EXCEPTION_THROWN;
(...skipping 29 matching lines...) Expand all
57 /** 60 /**
58 * Error code indicating the connection was unexpectedly reset. 61 * Error code indicating the connection was unexpectedly reset.
59 */ 62 */
60 public static final int ERROR_CONNECTION_RESET = UrlRequestError.CONNECTION_ RESET; 63 public static final int ERROR_CONNECTION_RESET = UrlRequestError.CONNECTION_ RESET;
61 /** 64 /**
62 * Error code indicating the IP address being contacted is unreachable, mean ing there is no 65 * Error code indicating the IP address being contacted is unreachable, mean ing there is no
63 * route to the specified host or network. 66 * route to the specified host or network.
64 */ 67 */
65 public static final int ERROR_ADDRESS_UNREACHABLE = UrlRequestError.ADDRESS_ UNREACHABLE; 68 public static final int ERROR_ADDRESS_UNREACHABLE = UrlRequestError.ADDRESS_ UNREACHABLE;
66 /** 69 /**
70 * Error code indicating an error related to the QUIC protocol.
pauljensen 2016/07/01 12:22:02 mention this class can be cast to QuicException fo
pauljensen 2016/07/01 12:22:02 linkify QUIC
mgersh 2016/07/01 15:21:15 Done.
mgersh 2016/07/01 15:21:15 Done.
71 */
72 public static final int ERROR_QUIC_PROTOCOL_FAILED = UrlRequestError.QUIC_PR OTOCOL_FAILED;
73 /**
67 * Error code indicating another type of error was encountered. 74 * Error code indicating another type of error was encountered.
68 * {@link #getCronetInternalErrorCode} can be consulted to get a more specif ic cause. 75 * {@link #getCronetInternalErrorCode} can be consulted to get a more specif ic cause.
69 */ 76 */
70 public static final int ERROR_OTHER = UrlRequestError.OTHER; 77 public static final int ERROR_OTHER = UrlRequestError.OTHER;
71 78
72 // Error code, one of ERROR_* 79 // Error code, one of ERROR_*
73 private final int mErrorCode; 80 private final int mErrorCode;
74 // Cronet internal error code. 81 // Cronet internal error code.
75 private final int mCronetInternalErrorCode; 82 private final int mCronetInternalErrorCode;
76 83
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 return false; 155 return false;
149 case ERROR_NETWORK_CHANGED: 156 case ERROR_NETWORK_CHANGED:
150 case ERROR_TIMED_OUT: 157 case ERROR_TIMED_OUT:
151 case ERROR_CONNECTION_CLOSED: 158 case ERROR_CONNECTION_CLOSED:
152 case ERROR_CONNECTION_TIMED_OUT: 159 case ERROR_CONNECTION_TIMED_OUT:
153 case ERROR_CONNECTION_RESET: 160 case ERROR_CONNECTION_RESET:
154 return true; 161 return true;
155 } 162 }
156 } 163 }
157 } 164 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698