OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 /** | 7 /** |
8 * HTTP status codes. | 8 * HTTP status codes. |
9 */ | 9 */ |
10 abstract class HttpStatus { | 10 abstract class HttpStatus { |
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 * unparsed data already read from the socket. This unparsed data | 1346 * unparsed data already read from the socket. This unparsed data |
1347 * together with the detached socket is returned in an instance of | 1347 * together with the detached socket is returned in an instance of |
1348 * this class. | 1348 * this class. |
1349 */ | 1349 */ |
1350 abstract class DetachedSocket { | 1350 abstract class DetachedSocket { |
1351 Socket get socket; | 1351 Socket get socket; |
1352 List<int> get unparsedData; | 1352 List<int> get unparsedData; |
1353 } | 1353 } |
1354 | 1354 |
1355 | 1355 |
1356 class HttpException implements Exception { | 1356 class HttpException implements IOException { |
| 1357 final String message; |
| 1358 |
1357 const HttpException([String this.message = ""]); | 1359 const HttpException([String this.message = ""]); |
| 1360 |
1358 String toString() => "HttpException: $message"; | 1361 String toString() => "HttpException: $message"; |
1359 final String message; | |
1360 } | 1362 } |
1361 | 1363 |
1362 | 1364 |
1363 class RedirectException extends HttpException { | 1365 class RedirectException implements HttpException { |
1364 const RedirectException(String message, | 1366 final String message; |
1365 List<RedirectInfo> this.redirects) : super(message); | |
1366 final List<RedirectInfo> redirects; | 1367 final List<RedirectInfo> redirects; |
| 1368 |
| 1369 const RedirectException(String this.message, |
| 1370 List<RedirectInfo> this.redirects); |
| 1371 |
| 1372 String toString() => "RedirectException: $message"; |
1367 } | 1373 } |
1368 | |
1369 | |
1370 class RedirectLimitExceededException extends RedirectException { | |
1371 const RedirectLimitExceededException(List<RedirectInfo> redirects) | |
1372 : super("Redirect limit exceeded", redirects); | |
1373 } | |
1374 | |
1375 | |
1376 class RedirectLoopException extends RedirectException { | |
1377 const RedirectLoopException(List<RedirectInfo> redirects) | |
1378 : super("Redirect loop detected", redirects); | |
1379 } | |
OLD | NEW |