OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library oauth2.authorization_exception; | |
6 | |
7 /// An exception raised when OAuth2 authorization fails. | 5 /// An exception raised when OAuth2 authorization fails. |
8 class AuthorizationException implements Exception { | 6 class AuthorizationException implements Exception { |
9 /// The name of the error. | 7 /// The name of the error. |
10 /// | 8 /// |
11 /// Possible names are enumerated in [the spec][]. | 9 /// Possible names are enumerated in [the spec][]. |
12 /// | 10 /// |
13 /// [the spec]: http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-5.2 | 11 /// [the spec]: http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-5.2 |
14 final String error; | 12 final String error; |
15 | 13 |
16 /// The description of the error, provided by the server. | 14 /// The description of the error, provided by the server. |
(...skipping 14 matching lines...) Expand all Loading... |
31 String toString() { | 29 String toString() { |
32 var header = 'OAuth authorization error ($error)'; | 30 var header = 'OAuth authorization error ($error)'; |
33 if (description != null) { | 31 if (description != null) { |
34 header = '$header: $description'; | 32 header = '$header: $description'; |
35 } else if (uri != null) { | 33 } else if (uri != null) { |
36 header = '$header: $uri'; | 34 header = '$header: $uri'; |
37 } | 35 } |
38 return '$header.'; | 36 return '$header.'; |
39 } | 37 } |
40 } | 38 } |
OLD | NEW |