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

Unified Diff: components/cronet/android/java/src/org/chromium/net/UrlRequestException.java

Issue 586143002: Initial implementation of Cronet Async API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync 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
Index: components/cronet/android/java/src/org/chromium/net/UrlRequestException.java
diff --git a/components/cronet/android/java/src/org/chromium/net/UrlRequestException.java b/components/cronet/android/java/src/org/chromium/net/UrlRequestException.java
index 6d1d621239f7cf8cd25e0ae8f32d08866de58d41..3557324c1e7b6d5d716131b5cf30fdafb215360f 100644
--- a/components/cronet/android/java/src/org/chromium/net/UrlRequestException.java
+++ b/components/cronet/android/java/src/org/chromium/net/UrlRequestException.java
@@ -7,7 +7,25 @@ package org.chromium.net;
import java.io.IOException;
/**
- *
+ * Exception after UrlRequest start. Could be reported by network stack, in
+ * which case netError() will contain native error code.
*/
public class UrlRequestException extends IOException {
+ /** Net error code if exception is reported by native. */
+ final int mNetError;
+
+ UrlRequestException(String message, Throwable cause) {
+ super(message, cause);
+ mNetError = 0;
+ }
+
+ UrlRequestException(String message, int netError) {
+ super(message, null);
+ mNetError = netError;
+ }
+
+ /** @return Error code if exception is reported by native. */
+ public int netError() {
+ return mNetError;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698