Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: pkg/oauth2/lib/src/authorization_exception.dart

Issue 16019002: Merge the dart:uri library into dart:core and update the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final cleanup Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/oauth2/lib/src/authorization_code_grant.dart ('k') | pkg/oauth2/lib/src/client.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 authorization_exception; 5 library authorization_exception;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:uri';
9 8
10 /// An exception raised when OAuth2 authorization fails. 9 /// An exception raised when OAuth2 authorization fails.
11 class AuthorizationException implements Exception { 10 class AuthorizationException implements Exception {
12 /// The name of the error. Possible names are enumerated in [the spec][]. 11 /// The name of the error. Possible names are enumerated in [the spec][].
13 /// 12 ///
14 /// [the spec]: http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-5.2 13 /// [the spec]: http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-5.2
15 final String error; 14 final String error;
16 15
17 /// The description of the error, provided by the server. Defaults to null. 16 /// The description of the error, provided by the server. Defaults to null.
18 final String description; 17 final String description;
19 18
20 /// A URI for a page that describes the error in more detail, provided by the 19 /// A URI for a page that describes the error in more detail, provided by the
21 /// server. Defaults to null. 20 /// server. Defaults to null.
22 final Uri uri; 21 final Uri uri;
23 22
24 /// Creates an AuthorizationException. 23 /// Creates an AuthorizationException.
25 AuthorizationException(this.error, this.description, this.uri); 24 AuthorizationException(this.error, this.description, this.uri);
26 25
27 /// Provides a string description of the AuthorizationException. 26 /// Provides a string description of the AuthorizationException.
28 String toString() { 27 String toString() {
29 var header = 'OAuth authorization error ($error)'; 28 var header = 'OAuth authorization error ($error)';
30 if (description != null) { 29 if (description != null) {
31 header = '$header: $description'; 30 header = '$header: $description';
32 } else if (uri != null) { 31 } else if (uri != null) {
33 header = '$header: $uri'; 32 header = '$header: $uri';
34 } 33 }
35 return '$header.'; 34 return '$header.';
36 } 35 }
37 } 36 }
OLDNEW
« no previous file with comments | « pkg/oauth2/lib/src/authorization_code_grant.dart ('k') | pkg/oauth2/lib/src/client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698