-
Notifications
You must be signed in to change notification settings - Fork 2
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
improve ReQL error messages #13
Comments
Indeed the It would be nice if we could change the formatting for backtraces in the Data Explorer so that it highlights the failing part in bold red or something like that, rather than trying to underline it with (additionally there are a few errors that don't generate correct backtraces so the @tve As a work-around, you might have more luck by copying the error output from the Data Explorer into an editor that doesn't break lines. Then the |
@danielmewes -- we could also move to multi-line pretty-printing in the JS driver. The Ruby driver prints queries like this:
which is both much easier to read, and makes it clearer where the error occured. |
Oh indeed. I like that solution because it will also work outside the Data Explorer (though you can probably construct queries for which the lines would still be too long). |
I find the ReQL error messages in the UI very frustrating because they don't pinpoint the error location. For example, where does this error occur?
e: No attribute
baz
in object:{
"links": {
"parent": "/api/resource/55"
}
} in:
r({"fields": {"color": "red", "size": 10, "shape": "round", "tags": ["awesome", "cool"], "margin": {"top": 0, "bot": 1}}, "databags": {"links": {"parent": "/api/resource/55"}}, "ix": ["color", "size", "tags", "margin", "baz"], "databag_ix": {"links": ["parent"], "baz": ["tada"]}}).do(function(var_63) { return var_63("ix").concatMap(function(var_64) { return r.branch(var_63("fields").hasFields(var_64), var_63("fields")(var_64).do(function(var_65) { return r.branch(var_65.typeOf().eq("ARRAY"), var_65.map(function(var_66) { return ["", var_64, var_66]; }), var_65.typeOf().eq("OBJECT"), var_65.keys().map(function(var_67) { return ["", var_67, var_65(var_67)]; }), [["", var_64, var_65]]); }), []); }).spliceAt(0, var_63("databag_ix").keys().concatMap(function(var_68) { return var_63("databag_ix")(var_68).default([]).concatMap(function(var_69) { return r.branch(var_63("databags")(var_68).default([]).hasFields(var_69), var_63("databags")(var_68)(var_69).do(function(var_70) { return r.branch(var_70.typeOf().eq("ARRAY"), var_70.map(function(var_71) { return [var_68, var_69, var_71]; }), var_70.typeOf().eq("OBJECT"), var_70.keys().map(function(var_72) { return [var_68, var_72, var_70(var_72)]; }), [[var_68, var_69, var_70]]); }), []); }); })); })
^^^^^^^^^^^^^^^^^^^^^^^^^^
I assume the line of ^ is intended to point to the error, but I can't for the life of me figure it out...
(Apologies if there is already an issue open for this, I couldn't find it).
The text was updated successfully, but these errors were encountered: