Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dartdoc should have a better error message for invalid reexports #1745

Closed
jcollins-g opened this issue Aug 22, 2018 · 1 comment · Fixed by #1748
Closed

dartdoc should have a better error message for invalid reexports #1745

jcollins-g opened this issue Aug 22, 2018 · 1 comment · Fixed by #1748
Labels
customer-fuchsia Issues originating from or important to Fuchsia P2 A bug or feature request we're likely to work on

Comments

@jcollins-g
Copy link
Contributor

Problems in the analyzer in resolving export directives due to missing files currently result in ugly exceptions. Convert this to a dartdoc error (or possibly, warning) instead that gives an indication of where the problem is, and keep going on doc generation.

Generation failed: NoSuchMethodError: The getter 'exports' was called on null.
Receiver: null
Tried calling: exports
dart:core                               Object.noSuchMethod
package:dartdoc/src/model.dart 4405:58  PackageGraph._tagReexportsFor
package:dartdoc/src/model.dart 4406:7   PackageGraph._tagReexportsFor
package:dartdoc/src/model.dart 4406:7   PackageGraph._tagReexportsFor
package:dartdoc/src/model.dart 4417:9   PackageGraph.libraryElementReexportedBy
package:dartdoc/src/model.dart 4536:9   PackageGraph.findLibraryFor
package:dartdoc/src/model.dart 4724:28  PackageGraph.findOrCreateLibraryFor
package:dartdoc/src/model.dart 4050:7   new PackageGraph.<fn>
dart:collection                         __CompactLinkedHashSet&_HashFieldBase&_HashBase&_OperatorEqualsAndHashCode&SetMixin.forEach
package:dartdoc/src/model.dart 4049:28  new PackageGraph
package:dartdoc/src/model.dart 5511:16  PackageBuilder.buildPackageGraph
===== asynchronous gap ===========================
dart:async                              _AsyncAwaitCompleter.completeError
package:dartdoc/src/model.dart          PackageBuilder.buildPackageGraph
===== asynchronous gap ===========================
dart:async                              _asyncThenWrapperHelper
package:dartdoc/src/model.dart          PackageBuilder.buildPackageGraph
package:dartdoc/dartdoc.dart 139:26     Dartdoc.generateDocs
@jcollins-g jcollins-g added P2 A bug or feature request we're likely to work on customer-fuchsia Issues originating from or important to Fuchsia labels Aug 22, 2018
@jcollins-g
Copy link
Contributor Author

I think a solution to this should keep track of the recursive _tagReexportsFor calls and print a trace of the exports traveled from the original LibraryElement to the one that is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-fuchsia Issues originating from or important to Fuchsia P2 A bug or feature request we're likely to work on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant