Report all available libraries in exceptions.

There are two kinds: which we just built, and from readers.
With this change we will cover also just built libraries.

Change-Id: I67fa8ec5eeb00e539b4bd648d35b547dea8b4a7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232686
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Konstantin Shcheglov 2022-02-12 01:49:21 +00:00 committed by Commit Bot
parent a646c11592
commit 85cdbe31ca

View file

@ -71,9 +71,10 @@ class LinkedElementFactory {
var reader = _libraryReaders[uriStr];
if (reader == null) {
var libraryUriList = rootReference.children.map((e) => e.name).toList();
throw ArgumentError(
'Missing library: $uriStr\n'
'Available libraries: ${_libraryReaders.keys.toList()}',
'Available libraries: $libraryUriList',
);
}