OLD | NEW |
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 * | 10 * |
11 */ | 11 */ |
12 public class UrlRequestException extends IOException { | 12 public class UrlRequestException extends IOException { |
| 13 /** Net Error code if exception is reported by native. */ |
| 14 final int mNetError; |
| 15 |
| 16 UrlRequestException(String message, Throwable cause) { |
| 17 super(message, cause); |
| 18 mNetError = 0; |
| 19 } |
| 20 |
| 21 UrlRequestException(String message, int netError) { |
| 22 super(message, null); |
| 23 mNetError = netError; |
| 24 } |
| 25 |
| 26 /** @return Error code if exception is reported by native. */ |
| 27 public int netError() { |
| 28 return mNetError; |
| 29 } |
13 } | 30 } |
OLD | NEW |