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

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

Issue 11412083: Fix OAuth2 tests, and disable them on non-dart:io platforms. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « no previous file | pkg/oauth2/lib/src/expiration_exception.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';
8 9
9 /// An exception raised when OAuth2 authorization fails. 10 /// An exception raised when OAuth2 authorization fails.
10 class AuthorizationException implements Exception { 11 class AuthorizationException implements Exception {
11 /// The name of the error. Possible names are enumerated in [the spec][]. 12 /// The name of the error. Possible names are enumerated in [the spec][].
12 /// 13 ///
13 /// [the spec]: http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-5.2 14 /// [the spec]: http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-5.2
14 final String error; 15 final String error;
15 16
16 /// The description of the error, provided by the server. Defaults to null. 17 /// The description of the error, provided by the server. Defaults to null.
17 final String description; 18 final String description;
18 19
19 /// A URI for a page that describes the error in more detail, provided by the 20 /// A URI for a page that describes the error in more detail, provided by the
20 /// server. Defaults to null. 21 /// server. Defaults to null.
21 final Uri uri; 22 final Uri uri;
22 23
23 /// Creates an AuthorizationException. 24 /// Creates an AuthorizationException.
24 AuthorizationException(this.error, this.description, this.uri); 25 AuthorizationException(this.error, this.description, this.uri);
25 26
26 /// Provides a string description of the AuthorizationException. 27 /// Provides a string description of the AuthorizationException.
27 String toString() { 28 String toString() {
28 var header = 'OAuth authorization error ($error)'; 29 var header = 'OAuth authorization error ($error)';
29 if (description != null) { 30 if (description != null) {
30 header = '$header: $description'; 31 header = '$header: $description';
31 } else if (uri != null) { 32 } else if (uri != null) {
32 header = '$header: $uri'; 33 header = '$header: $uri';
33 } 34 }
34 return '$header.'; 35 return '$header.';
35 } 36 }
36 } 37 }
OLDNEW
« no previous file with comments | « no previous file | pkg/oauth2/lib/src/expiration_exception.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698