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

"Unhandled exception:" error #30

Closed
mikezamayias opened this issue Dec 16, 2020 · 4 comments
Closed

"Unhandled exception:" error #30

mikezamayias opened this issue Dec 16, 2020 · 4 comments

Comments

@mikezamayias
Copy link

I'm always getting the following output when running dcdg:

Unhandled exception:
FileSystemException: Directory listing failed, path = '/home/mzamayias/Documents/Repositories/glowing-sniffle/Current Courses/Agile Programming/Assignments/Assignment 2/dart/simple_hearts_game/lib/' (OS Error: No such file or directory, errno = 2)
#0 _Directory._fillWithDirectoryListing (dart:io-patch/directory_patch.dart:37:68)
#1 _Directory.listSync (dart:io/directory_impl.dart:243:5)
#2 findClassElements (package:dcdg/src/find_class_elements.dart:35:8)
#3 main (file:///home/mzamayias/.pub-cache/hosted/pub.dartlang.org/dcdg-2.0.1/bin/dcdg.dart:28:25)
#4 _startIsolate. (dart:isolate-patch/isolate_patch.dart:299:32)
#5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Am I doing something wrong? I've followed the instructions for installation and usage. Also, as this my first Issue report on GitHub, am I doing it right?

@glesica
Copy link
Owner

glesica commented Dec 16, 2020

Interesting. Could you try it on a path that doesn't have any spaces? I've seen Dart get cranky about that before.

@mikezamayias
Copy link
Author

mikezamayias commented Dec 17, 2020

I've copied the project to Desktop/ and tried dcdg -o 'uml.puml' and pub global run dcdg -o 'uml.puml' with both giving the same Unhandled exception: FileSystemException: Directory listing failed.

I'm checking again how to use dcdg and I'm curious, on which file should I import the package, on all of them or just on the "main".dart? I've got each class on a separate file. Could this cause the error?

@glesica
Copy link
Owner

glesica commented Dec 17, 2020

Oh, I think I see. You don't import DCDG into your project, you run it on your source code. Do you have a lib/ directory in your project? DCDG assumes that you are using a standard Dart package layout, which includes a lib/ directory (where your code lives).

@mikezamayias
Copy link
Author

Turns out my project was not in a package layout. After some tinkering I had a Dart package that would run successfully, then tried pub global run dcdg -o 'uml.puml' and voilà, I had the uml.puml for my classes. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants