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

Fix unhelpful error message for node evaluators #1470

Merged
merged 1 commit into from
Aug 1, 2017
Merged

Conversation

desa
Copy link
Contributor

@desa desa commented Jul 6, 2017

Fixes #1452

Log line now reads like

[missing:where2] 2017/07/07 11:05:08 E! error while evaluating expression: Cannot call function "sigma" with args ("y": missing), available signatures are [(float)].
Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated

@nathanielc
Copy link
Contributor

@desa I am not quite sure how to read that error message. Does the : indicate type information follows?

So if I called a function like foo("y", "x") and "y" is missing I get an error like:

Cannot call function "foo" with args ("y": missing, "x": int64), available signatures are [(float, int64)].

That seems confusing to me as it requires the read to understand that missing is a type inside lambda functions and figure out that their value is missing which is why the function cannot be called.

How hard is it to detect that 1. there is not valid signature and 2. special case the missing type to have a direct error message that says something like Cannot call function "foo" argument "y" is missing, values in scope are [...]? Then errors about type mismatch (excluding missing) can list the arg types, and available signatures as above.

@desa
Copy link
Contributor Author

desa commented Jul 24, 2017

@nathanielc

Does the : indicate type information follows?

Yup.

  1. there is not valid signature
  2. special case the missing type to have a direct error message

Special casing missing should be easy.

Just so I'm not off track, the end result is that we'll have two types of error messages.

  1. One for missing types that will read
Cannot call function "foo" argument "y" is missing, values in scope are [...]?

Any thoughts on what the log line should look like if there are multiple missing arguments? And should the values in [...] include type information?

  1. One for all other types that will read
Cannot call function "foo" with args ("y": missing, "x": int64), available signatures are [(float, int64)].

@nathanielc
Copy link
Contributor

If there are multiple missing list them all. Do not include type information in the list of vars in scope. The idea is to make it easier to spot a typo or similar in the names of the vars.

Sounds like we are on the same page.

@desa desa merged commit 0f17613 into master Aug 1, 2017
@desa desa deleted the md-issue#1452 branch August 1, 2017 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants