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

Script not found results in a stack track #522

Closed
lihaoyi opened this issue Dec 9, 2016 · 0 comments
Closed

Script not found results in a stack track #522

lihaoyi opened this issue Dec 9, 2016 · 0 comments

Comments

@lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Dec 9, 2016

If you try and run a script that doesn't exist, it blows up with a stack trace

lihaoyi Resume$ amm Resume.
Exception in thread "main" java.nio.file.NoSuchFileException: /Users/lihaoyi/Dropbox/Workspace/Resume/Resume.
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
	at java.nio.file.Files.newByteChannel(Files.java:361)
	at java.nio.file.Files.newByteChannel(Files.java:407)
	at java.nio.file.Files.readAllBytes(Files.java:3152)
	at ammonite.ops.Path.getBytes(Path.scala:299)
	at ammonite.ops.read$.apply(FileOps.scala:330)
	at ammonite.ops.read$.apply(FileOps.scala:329)
	at ammonite.main.Scripts$.runScript(Scripts.scala:24)
	at ammonite.Main.runScript(Main.scala:121)
	at ammonite.Main$$anonfun$main$1$$anonfun$apply$1.apply(Main.scala:251)
	at ammonite.Main$.ammonite$Main$$ifContinually$1(Main.scala:228)
	at ammonite.Main$$anonfun$main$1.apply(Main.scala:230)
	at ammonite.Main$$anonfun$main$1.apply(Main.scala:230)
	at scala.Option.foreach(Option.scala:257)
	at ammonite.Main$.main(Main.scala:230)

This is a pretty common error and we should hide the stack trace behind a pretty error message

tkroman added a commit to tkroman/Ammonite that referenced this issue Dec 10, 2016
@lihaoyi lihaoyi closed this in da49f94 May 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant