We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18a7631 commit cbc1885Copy full SHA for cbc1885
lib/src/model/prefix.dart
@@ -36,9 +36,14 @@ class Prefix extends ModelElement with HasNoPage {
36
.firstWhere((i) => i.prefix2?.element == element);
37
var importedLibrary = libraryImport.importedLibrary2;
38
if (importedLibrary == null) {
39
- throw StateError(
40
- 'Unexpected null LibraryElement2 for imported library at '
41
- '${libraryImport.uri}');
+ var message = 'Unexpected null LibraryElement2 for imported library at '
+ '${library.element.firstFragment.source.uri}, at offset '
+ '${libraryImport.importKeywordOffset}';
42
+ var directiveUri = libraryImport.uri;
43
+ if (directiveUri is DirectiveUriWithRelativeUriString) {
44
+ message += 'for import URI: "${directiveUri.relativeUriString}"';
45
+ }
46
+ throw StateError(message);
47
}
48
return importedLibrary;
49
0 commit comments