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

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

Issue 14135014: Adding Uri.parse to AuthorizationException (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Moving to next line Created 7 years, 7 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 | « no previous file | no next file » | 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 oauth2_client; 5 library oauth2_client;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:uri'; 8 import 'dart:uri';
9 9
10 import 'package:http/http.dart' as http; 10 import 'package:http/http.dart' as http;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } on FormatException catch (e) { 102 } on FormatException catch (e) {
103 return response; 103 return response;
104 } 104 }
105 105
106 if (authenticate.scheme != 'bearer') return response; 106 if (authenticate.scheme != 'bearer') return response;
107 107
108 var params = authenticate.parameters; 108 var params = authenticate.parameters;
109 if (!params.containsKey('error')) return response; 109 if (!params.containsKey('error')) return response;
110 110
111 throw new AuthorizationException( 111 throw new AuthorizationException(
112 params['error'], params['error_description'], params['error_uri']); 112 params['error'], params['error_description'],
113 Uri.parse(params['error_uri']));
113 }); 114 });
114 } 115 }
115 116
116 /// Explicitly refreshes this client's credentials. Returns this client. 117 /// Explicitly refreshes this client's credentials. Returns this client.
117 /// 118 ///
118 /// This will throw a [StateError] if the [Credentials] can't be refreshed, an 119 /// This will throw a [StateError] if the [Credentials] can't be refreshed, an
119 /// [AuthorizationException] if refreshing the credentials fails, or a 120 /// [AuthorizationException] if refreshing the credentials fails, or a
120 /// [FormatError] if the authorization server returns invalid responses. 121 /// [FormatError] if the authorization server returns invalid responses.
121 /// 122 ///
122 /// You may request different scopes than the default by passing in 123 /// You may request different scopes than the default by passing in
(...skipping 14 matching lines...) Expand all
137 return this; 138 return this;
138 }); 139 });
139 } 140 }
140 141
141 /// Closes this client and its underlying HTTP client. 142 /// Closes this client and its underlying HTTP client.
142 void close() { 143 void close() {
143 if (_httpClient != null) _httpClient.close(); 144 if (_httpClient != null) _httpClient.close();
144 _httpClient = null; 145 _httpClient = null;
145 } 146 }
146 } 147 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698