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
Arity errors #2463
Comments
Actually, we could have one term for
Same thing for the other commands, especially for |
That sounds really bad to me. The terms sent to the server should represent an AST, which should be independent of what people typed to produce it. We'd end up having two of every term, and some languages (like Clojure or C) would only ever send half of them, then on the server we'd turn them into one "real" term. I would rather make the server return structured error messages ({type: 'type_error', term: 'add', arg: '3', message: ..., bt: ...}) so that drivers can choose to render them in driver-specific ways (since the driver knows whether you were using infix or postfix notation to generate the AST). |
👍 |
So if the driver wants to make the distinction between the two notations, it has to build a second "query" that keeps track of the notation used, which is cumbersome to do. That being said, I'm ok just sending back a structured error message for now. That would make errors way more readable. |
For
The server will send back this error:
The error we send back is not super-friendly because
r.zip(r.table('test'), 1)
About the last point,
r.and
is a valid syntax, so we can't just suppose that we always chain methods. But if the function that triggered the error was reported, the driver could catch the error and update the number of arguments depending of the method.Putting in polish.
The text was updated successfully, but these errors were encountered: