Chromium Code Reviews

Side by Side Diff: sdk/lib/_internal/pub/lib/src/source/hosted.dart

Issue 354663008: Clean up pub's exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
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 pub.source.hosted; 5 library pub.source.hosted;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io' as io; 8 import 'dart:io' as io;
9 import "dart:convert"; 9 import "dart:convert";
10 10
11 import 'package:http/http.dart' as http; 11 import 'package:http/http.dart' as http;
12 import 'package:path/path.dart' as path; 12 import 'package:path/path.dart' as path;
13 13
14 import '../exceptions.dart';
14 import '../http.dart'; 15 import '../http.dart';
15 import '../io.dart'; 16 import '../io.dart';
16 import '../log.dart' as log; 17 import '../log.dart' as log;
17 import '../package.dart'; 18 import '../package.dart';
18 import '../pubspec.dart'; 19 import '../pubspec.dart';
19 import '../utils.dart'; 20 import '../utils.dart';
20 import '../version.dart'; 21 import '../version.dart';
21 import 'cached.dart'; 22 import 'cached.dart';
22 23
23 /// A package source that gets packages from a package hosting site that uses 24 /// A package source that gets packages from a package hosting site that uses
(...skipping 329 matching lines...)
353 var name = description["name"]; 354 var name = description["name"];
354 if (name is! String) { 355 if (name is! String) {
355 throw new FormatException("The 'name' key must have a string value."); 356 throw new FormatException("The 'name' key must have a string value.");
356 } 357 }
357 358
358 var url = description["url"]; 359 var url = description["url"];
359 if (url == null) url = HostedSource.defaultUrl; 360 if (url == null) url = HostedSource.defaultUrl;
360 361
361 return new Pair<String, String>(name, url); 362 return new Pair<String, String>(name, url);
362 } 363 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/source/git.dart ('k') | sdk/lib/_internal/pub/lib/src/source/path.dart » ('j') | no next file with comments »

Powered by Google App Engine