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

Side by Side Diff: pkg/analyzer/lib/src/generated/source.dart

Issue 1572073003: Don't log stack trace for a bad package URL in a source file. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.src.generated.source; 5 library analyzer.src.generated.source;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'package:analyzer/file_system/file_system.dart'; 10 import 'package:analyzer/file_system/file_system.dart';
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 throw new AnalysisException( 827 throw new AnalysisException(
828 "Cannot resolve a relative URI without a containing source: $contain edUri"); 828 "Cannot resolve a relative URI without a containing source: $contain edUri");
829 } 829 }
830 containedUri = containingSource.resolveRelativeUri(containedUri); 830 containedUri = containingSource.resolveRelativeUri(containedUri);
831 } 831 }
832 832
833 Uri actualUri = containedUri; 833 Uri actualUri = containedUri;
834 834
835 // Check .packages and update target and actual URIs as appropriate. 835 // Check .packages and update target and actual URIs as appropriate.
836 if (_packages != null && containedUri.scheme == 'package') { 836 if (_packages != null && containedUri.scheme == 'package') {
837 Uri packageUri = 837 Uri packageUri = null;
838 _packages.resolve(containedUri, notFound: (Uri packageUri) => null); 838 try {
839 packageUri =
840 _packages.resolve(containedUri, notFound: (Uri packageUri) => null);
841 } on ArgumentError {
842 // Fall through to try resolvers.
843 }
839 844
840 if (packageUri != null) { 845 if (packageUri != null) {
Brian Wilkerson 2016/01/09 16:02:39 This 'if' ought to be inside the 'try' because pac
skybrian 2016/01/09 19:26:45 That's true but it seems like it would be less cle
Brian Wilkerson 2016/01/10 16:55:25 I disagree (hence the comment), but it's your call
841 // Ensure scheme is set. 846 // Ensure scheme is set.
842 if (packageUri.scheme == '') { 847 if (packageUri.scheme == '') {
843 packageUri = packageUri.replace(scheme: 'file'); 848 packageUri = packageUri.replace(scheme: 'file');
844 } 849 }
845 containedUri = packageUri; 850 containedUri = packageUri;
846 } 851 }
847 } 852 }
848 853
849 for (UriResolver resolver in _resolvers) { 854 for (UriResolver resolver in _resolvers) {
850 Source result = resolver.resolveAbsolute(containedUri, actualUri); 855 Source result = resolver.resolveAbsolute(containedUri, actualUri);
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 Source resolveAbsolute(Uri uri, [Uri actualUri]); 1096 Source resolveAbsolute(Uri uri, [Uri actualUri]);
1092 1097
1093 /** 1098 /**
1094 * Return an absolute URI that represents the given [source], or `null` if a 1099 * Return an absolute URI that represents the given [source], or `null` if a
1095 * valid URI cannot be computed. 1100 * valid URI cannot be computed.
1096 * 1101 *
1097 * The computation should be based solely on [source.fullName]. 1102 * The computation should be based solely on [source.fullName].
1098 */ 1103 */
1099 Uri restoreAbsolute(Source source) => null; 1104 Uri restoreAbsolute(Source source) => null;
1100 } 1105 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698