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 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1392 * this class. | 1392 * this class. |
1393 */ | 1393 */ |
1394 abstract class DetachedSocket { | 1394 abstract class DetachedSocket { |
1395 Socket get socket; | 1395 Socket get socket; |
1396 List<int> get unparsedData; | 1396 List<int> get unparsedData; |
1397 } | 1397 } |
1398 | 1398 |
1399 | 1399 |
1400 class HttpException implements IOException { | 1400 class HttpException implements IOException { |
1401 final String message; | 1401 final String message; |
1402 | 1402 |
Bill Hesse
2013/07/05 12:57:45
Remove the blank line here?
Anders Johnsen
2013/08/20 05:46:31
Done.
| |
1403 const HttpException([String this.message = ""]); | 1403 final Uri uri; |
1404 | 1404 |
1405 String toString() => "HttpException: $message"; | 1405 const HttpException(String this.message, {Uri this.uri}); |
1406 | |
1407 String toString() { | |
1408 var b = new StringBuffer(); | |
1409 b.write('HttpException: '); | |
1410 b.write(message); | |
1411 if (uri != null) { | |
1412 b.write(', uri = $uri'); | |
1413 } | |
1414 return b.toString(); | |
Bill Hesse
2013/07/05 12:57:45
How about
(uri == null) ? "HttpException: $messag
Anders Johnsen
2013/08/20 05:46:31
We use buffers in other exceptions, I think it's f
| |
1415 } | |
1406 } | 1416 } |
1407 | 1417 |
1408 | 1418 |
1409 class RedirectException implements HttpException { | 1419 class RedirectException implements HttpException { |
1410 final String message; | 1420 final String message; |
1411 final List<RedirectInfo> redirects; | 1421 final List<RedirectInfo> redirects; |
1412 | 1422 |
1413 const RedirectException(String this.message, | 1423 const RedirectException(String this.message, |
1414 List<RedirectInfo> this.redirects); | 1424 List<RedirectInfo> this.redirects); |
1415 | 1425 |
1416 String toString() => "RedirectException: $message"; | 1426 String toString() => "RedirectException: $message"; |
1417 } | 1427 } |
OLD | NEW |