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

Unhelpful error message with malformed package-requires #284

Closed
phillord opened this issue Mar 11, 2015 · 6 comments
Closed

Unhelpful error message with malformed package-requires #284

phillord opened this issue Mar 11, 2015 · 6 comments

Comments

@phillord
Copy link
Collaborator

Cask produces a very strange error when there is a malformed package-require statement. The
error is as follows:

 [phillord@hydron:.../src/large/cask]$ cask install
 cask-source-position-line accessing a non-cask-source-position

This is pretty incomprehensible anyway, and is very hard to track down to the source cause -- in this case, I have reproduced it by deleting the last paren from the Package-Requires header in the cask source itself.

It has previously been noted in #280. While in this case, it was caused by evil-smartparens, I have raised a new issue because the error message is so hard to decipher. It's taken me about an hour with a debugger to find a missing paren in the comments of my package!

@rejeep
Copy link
Member

rejeep commented Mar 13, 2015

Can you try out this branch: https://github.com/cask/cask/tree/invalid-package-requires

@phillord
Copy link
Collaborator Author

Yes, that is much better and picks up the error in a much cleaner way.

This patch is specific to Package-Requires if I am not wrong? I ask because my natural impulse on getting "Invalidly balanced parens" is to do M-x check-paren, but this will not pick up the error because it is in the comments.

Would "Unbalanced parens in package headers" or "Unbalanced parens in Package-Requires" not be clearer still?

@rejeep
Copy link
Member

rejeep commented Mar 25, 2015

You are right, this is only a package requires issue. Updated the error message.

I'm thinking, maybe EPL should handle this error instead? What do you think @lunaryorn?

@swsnr
Copy link
Contributor

swsnr commented Mar 25, 2015

@rejeep I didn't follow this issue, so please forgive me if I'm wrong or saying anything that was already said, or is just plain stupid.

The real issue in this case was a malformed package, wasn't it? E.g. invalid package headers or something like that? In this case, yes, EPL should catch the error and transform it into a proper message, i.e. epl-invalid-package or something, that wraps the original error.

Would you mind to make a separate issue in EPL, so that I don't forget?

@rejeep
Copy link
Member

rejeep commented Mar 25, 2015

@lunaryorn You are correct! I opened up this issue: cask/epl#28

@rejeep
Copy link
Member

rejeep commented Mar 27, 2015

Merged, thanks for the help on EPL @lunaryorn and on reporting this issue @phillord!

@rejeep rejeep closed this as completed Mar 27, 2015
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

3 participants