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

Add toString() methods for things so error messages are nice. #47

Closed
erikrose opened this issue Dec 20, 2016 · 2 comments
Closed

Add toString() methods for things so error messages are nice. #47

erikrose opened this issue Dec 20, 2016 · 2 comments

Comments

@erikrose
Copy link
Contributor

Not everything has a toString() yet: rules in particular.

@erikrose erikrose added this to the 2.x milestone Dec 20, 2016
@erikrose erikrose modified the milestones: 2.x, 2.1 Jan 27, 2017
@erikrose erikrose modified the milestone: 2.1 Apr 19, 2017
@aruna09
Copy link

aruna09 commented Oct 13, 2017

Hey!! Could you elaborate more on this.

@erikrose
Copy link
Contributor Author

When structures like rules complain about their input, they aren't specific enough to tell which rule they're talking about. To find examples, you can pretty much just grep the code for throw. Here are a few:

throw new Error(`The right-hand side of a dom() rule failed to specify a type. This means there is no way for its output to be used by later rules. All it specified was ${fact}.`);
throw new Error('The left-hand side of a rule() must start with dom(), type(), or and().');

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