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 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2000 abstract class DetachedSocket { | 2000 abstract class DetachedSocket { |
2001 Socket get socket; | 2001 Socket get socket; |
2002 List<int> get unparsedData; | 2002 List<int> get unparsedData; |
2003 } | 2003 } |
2004 | 2004 |
2005 | 2005 |
2006 class HttpException implements IOException { | 2006 class HttpException implements IOException { |
2007 final String message; | 2007 final String message; |
2008 final Uri uri; | 2008 final Uri uri; |
2009 | 2009 |
2010 const HttpException(String this.message, {Uri this.uri}); | 2010 const HttpException(this.message, {this.uri}); |
2011 | 2011 |
2012 String toString() { | 2012 String toString() { |
2013 var b = new StringBuffer() | 2013 var b = new StringBuffer() |
2014 ..write('HttpException: ') | 2014 ..write('HttpException: ') |
2015 ..write(message); | 2015 ..write(message); |
2016 if (uri != null) { | 2016 if (uri != null) { |
2017 b.write(', uri = $uri'); | 2017 b.write(', uri = $uri'); |
2018 } | 2018 } |
2019 return b.toString(); | 2019 return b.toString(); |
2020 } | 2020 } |
2021 } | 2021 } |
2022 | 2022 |
2023 | 2023 |
2024 class RedirectException implements HttpException { | 2024 class RedirectException implements HttpException { |
2025 final String message; | 2025 final String message; |
2026 final List<RedirectInfo> redirects; | 2026 final List<RedirectInfo> redirects; |
2027 | 2027 |
2028 const RedirectException(this.message, this.redirects); | 2028 const RedirectException(this.message, this.redirects); |
2029 | 2029 |
2030 String toString() => "RedirectException: $message"; | 2030 String toString() => "RedirectException: $message"; |
2031 | 2031 |
2032 Uri get uri => redirects.last.location; | 2032 Uri get uri => redirects.last.location; |
2033 } | 2033 } |
OLD | NEW |