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

Side by Side Diff: lib/src/apis_package_generator.dart

Issue 648623002: Change throwing String to throwing ApiRequestError (Closed) Base URL: https://github.com/dart-lang/discovery_api_dart_client_generator.git@master
Patch Set: Created 6 years, 2 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
« 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 part of discovery_api_client_generator; 1 part of discovery_api_client_generator;
2 2
3 /// Generates a dart package with all APIs given in the constructor. 3 /// Generates a dart package with all APIs given in the constructor.
4 /// 4 ///
5 /// This class generates a dart package with the following layout: 5 /// This class generates a dart package with the following layout:
6 /// $packageFolderPath 6 /// $packageFolderPath
7 /// |- .gitignore 7 /// |- .gitignore
8 /// |- pubspec.yaml 8 /// |- pubspec.yaml
9 /// |- LICENSE 9 /// |- LICENSE
10 /// |- README.md 10 /// |- README.md
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 var end = lastChunk.endOfChunk; 844 var end = lastChunk.endOfChunk;
845 845
846 // Validate that we have the correct number of bytes if length was 846 // Validate that we have the correct number of bytes if length was
847 // specified. 847 // specified.
848 if (_uploadMedia.length != null) { 848 if (_uploadMedia.length != null) {
849 if (end < _uploadMedia.length) { 849 if (end < _uploadMedia.length) {
850 completer.completeError(new common_external.ApiRequestError( 850 completer.completeError(new common_external.ApiRequestError(
851 'Received less bytes than indicated by [Media.length].')); 851 'Received less bytes than indicated by [Media.length].'));
852 return; 852 return;
853 } else if (end > _uploadMedia.length) { 853 } else if (end > _uploadMedia.length) {
854 completer.completeError( 854 completer.completeError(new common_external.ApiRequestError(
855 'Received more bytes than indicated by [Media.length].'); 855 'Received more bytes than indicated by [Media.length].');
856 return; 856 return;
857 } 857 }
858 } 858 }
859 859
860 // Upload last chunk and *do not drain the response* but complete 860 // Upload last chunk and *do not drain the response* but complete
861 // with it. 861 // with it.
862 _uploadChunkResumable(uploadUri, lastChunk, lastChunk: true) 862 _uploadChunkResumable(uploadUri, lastChunk, lastChunk: true)
863 .then((response) { 863 .then((response) {
864 completer.complete(response); 864 completer.complete(response);
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after
2211 requester.request('s/foo/a1/a2/bar/s1/e', 'GET') 2211 requester.request('s/foo/a1/a2/bar/s1/e', 'GET')
2212 .then(expectAsync((response) { 2212 .then(expectAsync((response) {
2213 expect(response, isNull); 2213 expect(response, isNull);
2214 })); 2214 }));
2215 }); 2215 });
2216 }); 2216 });
2217 }); 2217 });
2218 } 2218 }
2219 """; 2219 """;
2220 } 2220 }
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