File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,14 @@ class Prefix extends ModelElement with HasNoPage {
36
36
.firstWhere ((i) => i.prefix2? .element == element);
37
37
var importedLibrary = libraryImport.importedLibrary2;
38
38
if (importedLibrary == null ) {
39
- throw StateError (
40
- 'Unexpected null LibraryElement2 for imported library at '
41
- '${libraryImport .uri }' );
39
+ var message = 'Unexpected null LibraryElement2 for imported library at '
40
+ '${library .element .firstFragment .source .uri }, at offset '
41
+ '${libraryImport .importKeywordOffset }' ;
42
+ var directiveUri = libraryImport.uri;
43
+ if (directiveUri is DirectiveUriWithRelativeUriString ) {
44
+ message += 'for import URI: "${directiveUri .relativeUriString }"' ;
45
+ }
46
+ throw StateError (message);
42
47
}
43
48
return importedLibrary;
44
49
}
You can’t perform that action at this time.
0 commit comments